I'm trying to get a player's mouse with the ':GetMouse()' function, but it only works in studio (only after I do wait(1) before that). I even did a repeat function looking for a mouse and it still didnt work.
Code:
game.Players.PlayerAdded:connect(function(player)
local mouse = player:GetMouse()
repeat wait(1) print('Searching for mouse...') until mouse
print("Found mouse")
end
This ONLY works in Studio, but in the server it doesn't (never prints found mouse, keeps printing searching for mouse over and over again).
How would I fix this?
Thanks!
The mouse can only be used from a localscript PlayerMouse
I cannot suggest how to go about fixing this as I don't know how it is being used.