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 3 years ago
Edited 3 years ago

Is there a way to get player from normal script?

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

1 answer

Log in to vote
1
Answered by 3 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 — 3y
Ad

Answer this question