Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

'Mouse' (A Nil Value)!?

Asked by 9 years ago

How can I got my mouse in a script in the workspace if we can ?

1
You really *shouldn't* manipulate the mouse in a server script, since your mouse it local to you. Perci1 4988 — 9y

1 answer

Log in to vote
-2
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
9 years ago

In a script, to define a variable for a Player's Mouse, simple use GetMouse. Must be a LocalScript

local Player = Game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
     print("Button 1 is down")
end)
0
I alreally know this but I want know if we can do it in a server script and in the worksapce not in a local script ! XToonLinkX123 580 — 9y
Ad

Answer this question