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

How do I get the player's through a regular script?

Asked by 9 years ago

Well normally, I would use a localscript and use :GetMouse() but this clearly doesn't work for scripts. How would I do this?

0
Conclusion: there is no how. Tesouro 407 — 9y

2 answers

Log in to vote
0
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
9 years ago

If you're script is in a tool, you can do:

script.Parent.Equipped:connect(function(mouse)
    --code
end)

Then use the built in parameter mouse. However, this would be better to do from a Local Script since it's inside a player.

This is the only way I know of to get the mouse from a server script, and even it may not work. Use a local script.

0
What original question? The only question I'm asking is how to get a player's mouse from a script within the player. xolbStudios 127 — 9y
0
Read it now Perci1 4988 — 9y
Ad
Log in to vote
0
Answered by
Nymint 85
9 years ago

You want to get their mouse in a server-side script? I don't think that's possible...

Be more specific? are you trying to get all players? just use:

local players=game.Players:GetPlayers()
for _,v in ipairs(players) do
local player=v
local playerMouse=player:GetMouse() --Might not work...
end

Answer this question