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

How do I define players through a regular script?

Asked by 4 years ago

So I always struggle define players through regular scripts. When you use a local script, you just use local player = game.Players.LocalPlayer but, I need to do this through a regular script. Is it even possible?

0
It's definitely possible, can you show us where you're struggling to define a player so we can offer some help? jediplocoon 877 — 4y

1 answer

Log in to vote
5
Answered by 4 years ago
Edited 4 years ago

You can use multiple things like using a ClickDetector,ClickDetector.MouseClick:Connect(function(player), the PlayerAdded event, Players.PlayerAdded:Connect(function(player), the GetPlayerFromCharacter function, commonly used with the Touched event of a part, Players:GetPlayerFromCharacter(hit.Parent), or using a remote event or function, RemoteEvent.OnServerEvent:Connect(function(player).

0
Is it possible to just straight up define the player though? Cynical_Innovation 595 — 4y
0
No. You can't use Players.LocalPlayer on a ServerScript (regular script). youtubemasterWOW 2741 — 4y
0
Oh, okay, thanks! Cynical_Innovation 595 — 4y
0
No problem. youtubemasterWOW 2741 — 4y
Ad

Answer this question