|
| 24 Feb 2016 09:43 PM |
Is there a way to make a script wait until at least one player has joined the server? I'm pretty sure there is a function to do this...
Here is the script:
while true do local smallest = {math.huge,nil} for _,v in pairs(game.Players:GetPlayers()) do local cur = v:DistanceFromCharacter(script.Parent.Parent.Torso.Position) if cur < smallest[1] then smallest[1] = cur smallest[2] = v end end
script.Parent.Value = smallest[2].Name wait() end
--//
I've tried to use the function "onPlayerAdded()", but it didn't seem to work?
~MightyDantheman |
|
|
| Report Abuse |
|
|
| |
|
|
| 24 Feb 2016 10:05 PM |
repeat wait(0.5) until (game.Players.NumPlayers >= 1)
-MetallicFrog | 15,000 posts | Scripter | Builder | |
|
|
| Report Abuse |
|
|
|
| 24 Feb 2016 10:10 PM |
Thank you!
~MightyDantheman |
|
|
| Report Abuse |
|
|