I was wondering, Does this script work? And how do you access all players for like teleporting all players and killing all players? (And how do you access a players backpack? Is it .backpack?) Script :
--[[ To leave comments type -- then your messsage. ex. --Add a timer. Put it next to the line you want me to add it to. ]]-- --[[VARIABLES]]-- timertext = script.Parent.Text mappicked = script.Parent.hasPickedMap intermissiontime = 20 timertime = 210 playersjoin = game.Players.NumPlayers --[[FUNCTIONS]]-- --function countplayers if playersjoin == 4 then --function intermission repeat wait(1) intermissiontime = intermissiontime - 1 timertext = intermissiontime until intermissiontime == 0 --function choosemap timertext = "Choosing map..." wait(1) map = math.random(game.Workspace.Folder) timertext = map map:clone(game.workspace) map.Position = "0,0,0" --function teleplayers timertext = "Teleporting players..." --teleportplayers --function choosemurderer murder = math.random(game.Players) game.ServerStorage["Murderer Knife"]:clone(murder.Backpack) end
Sorry for having a lot of questions, but also, how do you refresh a script, like, make the script reset and run again?
An easier way to do it is to use a for loop, example:
for i,v in pairs(game.Players:GetPlayers()) do v.--Whatever you want to do! end
Hope this helps, if it does, please accept my answer, it gives us both rep!
To access all the players you can do this:
local p = game.Players:GetChildren() for i = 1,#p do p[i].CharacterAdded:wait() p[i].Character.Humanoid.Health = 0 end
This is the simplest version.
To reset a script, you could
1. Clone it and put in the script's parent, then remove() the script.
2. Make the entire thing a while loop.