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

Is it possible for a script without playeradded event to fire before a playeradded event?

Asked by 2 years ago

Im asking this because I have a round script where I get the player and I set their team in another script

and I have a player added script where I also set the teams in that script

In this case which will fire first?

What I want is PlayerAdded to fire first before the other script fires

because my script will break if some other script fires before PlayerAdded

So is it possible for a script to get the player before PlayerAdded even fires?

0
No. It's impossible. DiamondComplex 285 — 2y
0
The player can't be gotten if the player event hasn't fired. So no, it can't happen. radiant_Light203 1166 — 2y

2 answers

Log in to vote
0
Answered by 2 years ago

Are the scripts in the same holder?

0
No Overseer_Prince 188 — 2y
Ad
Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

local Players = game:GetService("Players") Players.ChildAdded:Connect(function() -- this will fire as soon as someone joins the game -- add your script here for the team thing -- this can go in the script for the teams thing end) Players.ChildRemoved:Connect(function() -- this will fire as soon as someone joins the game -- add your script here for the team thing -- this can go in the script for the teams thing end) Players.Changed:Connect(function() -- this will fire when a player joins or leaves -- add your script here for the team thing -- this can go in the script for the teams thing end)
0
this will work im sure Stylxus 1 — 2y

Answer this question