local Mouse = game.Players:WaitForChild("Jack_Hase"):GetMouse() Mouse.Button1Down:connect(function(NEWKEY) MouseDown(NEWKEY) end) Mouse.Button1Up:connect(function(NEWKEY) MouseUp(NEWKEY) end) Mouse.KeyDown:connect(function(NEWKEY) KeyDown(NEWKEY) end) Mouse.KeyUp:connect(function(NEWKEY) KeyUp(NEWKEY) end)
I was fixing an old script (FE change I think) , but I kept getting an error at Mouse.Button1Down:connect(function(NEWKEY), saying the variable is nil even though right above it i define mouse, I've taken this part out of the script, same error nothing different, any solutions?
(also to all those people who spam replies what the error message was it is Workspace.Script:2: attempt to index local 'Mouse' (a nil value)
ok now dont spam my replies thank you)
Answered by yHasteeD. "You can't use :GetMouse() in ServerScripts, only in LocalScripts. And :connect is deprecated use :Connect and Mouse.KeyDown/Up is deprecated, use the UserInputService." Thank you! I've solved this problem in my script now