✓ Accepted answer
The :GetMouse() Function only works in localscripts, if it is in one already, check any errors with the Player variable. | If this was the answer, please mark it as the answer so I can get more reputation so I can help others as well. [Edited Below]
------------~
The script also uses only R15 so it will not have any effect on R6 users.
I have fixed your line of code as well:
plr = game.Players.LocalPlayer
local z = plr:GetMouse()
loaded = false
plr.CharacterAdded:connect(function()
loaded = true
end)
repeat wait() until loaded == true
plr.Character.Humanoid.Died:Connect(function()
loaded = false
end)
z.Button1Down:connect(function()
if loaded == true then
local v = Instance.new("BodyVelocity")
v.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
v.Velocity = z.hit.lookVector * 100
v.Parent = plr.Character.UpperTorso
end
end)
11 comments
yea when I put it in local the script does work in studio but not in game :/ I also get no errors in game.
Studio has a lot of bugs. Ton of them.
Though, they had that error where it works with local script, but in game it only works with ordinary scripts for a while now.
By the way, if this is the answer you hoped for, press the answer button on this question.
Well I put it in a local script but it still doesn’t work ingame :/
Odd, let me try and find out.
Oh yea the game is FE I don’t know if thats the reason why it doesn’t work. I did use remote event though
I have solved it!
I have edited the answer.
Please put this as answered if the new edit helped.
Oh Thank you so much I will be trying it out now