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!

4 comments
How would I use it from a server script?
All I need to do is figure out if a player pressed a button, so how would I do that from a serverscript?
mouse is client side so the server has no access, if you include some background info to what you are trying to do i may be able to suggest how to go about this problem.
Okay, I just made it part of the client. Thanks!