RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a first person shooter system"
-- client script: local aimCount = 0; local offset = weapon.Handle.CFrame:inverse() * weapon.Aim.CFrame; local function aimDownSights(aiming) local start = joint.C1; local goal = aiming and joint.C0 * offset or CFrame.new(); aimCount = aimCount 1; local current = aimCount; for t = 0, 101, 10 do if (current ~= aimCount) then break; end game:GetService("RunService").RenderStepped:Wait(); joint.C1 = start:Lerp(goal, t/100); end end local function onInputBegan(input, process) if (process) then return; end if (input.UserInputType == Enum.UserInputType.MouseButton2) then aimDownSights(true); end end local function onInputEnded(input, process) if (process) then return; end if (input.UserInputType == Enum.UserInputType.MouseButton2) then aimDownSights(false); end end