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

Is there a way to get player from normal script? [In variable]

Asked by 2 years ago
Edited 2 years ago

Is there a way to get player from normal script?

0
What do you mean? WINDOWS10XPRO 438 — 2y
0
game.Players.PlayerAdded:Connect(function(ThisVariableIsThePlayer) -- code here end) I'm pretty sure you wanted this greatneil80 2647 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

This is not a request site, but ill cut you some slack.

game.Players.PlayerAdded:Connect(function(p)


end)

"p" is the player in this function.

This determines the player in this script.

Local Scripts get the player in a different way.

--In a local script

local player = game.Players.LocalPlayer

The last way of getting the player is by using,

local player = game:GetService("Players"). LocalPlayer

I hope this helps!

0
Accept if this works. Ponytails2017 83 — 2y
Ad

Answer this question