why does my mouse click input method not work in-game, but works fine in studio test mode?
For example, if I made a local script saying:
1 | local plr = game.Players.LocalPlayer; |
2 | local m = plr:GetMouse(); |
3 | m.Button 1 Down:connect( function () |
4 | print (plr.Name.. "'s mouse clicked" ); |
it would work perfectly in-studio test mode, but when you go to play the actual game on your ROBLOX client (In-game) it doesn't work at all! Now your next instinct may be to use UserInputService, but if I altered the local script to:
1 | local plr = game.Players.LocalPlayer; |
2 | game:GetService( "UserInputService" ).InputBegan:connect( function (input) |
3 | if input.UserInputType = = Enum.UserInputType.MouseButton 1 then |
4 | print ( "plr.Name.." 's mouse clicked"); |
But this still behaves the same way! It STILL will only work in-studio mode, and it literally won't work at all in-game. Did ROBLOX deprecate these methods? should I be using a remote function instead? I am kind of lost with this, I need to get this mouse click input to work in-game. Any help would be much appreciated, thanks.