i have a made a script based on round system there is a problem shown in output it is not being showed in script Analysis. my script ends without being finished. please help me.
I am working on a Round System. i don't know much in scripting just running using Youtube. if there is a expert Person Who Know Scripting then can contact me let me know your user if you know scripting.
Script:
local s =script.Stat local vals = game.ReplicatedStorage.vals t = 0 while true do t = 15 repeat t = t-1 s.Value = "Intermission.. "..t wait(1) until t == 0 s.Value = "Game Starting" wait(2) local mapselect = game.ReplicatedStorage.Games:GetChildren() local choose = math.random(1,#mapselect) curnum = 0 for i =1,#mapselect do curnum = curnum +1 if curnum == choose then mapselect[i]:Clone().Parent = workspace curnum = mapselect[i].Name s.Value = "We'll Be Playing "..mapselect[i].name end end wait(3) local plrs = game.Players:GetChildren() for i =1,#plrs do local num = math.random(1,32) plrs[i].Character.Head.CFrame = CFrame.new(workspace.Teleports["Part"..num].Position) plrs[i].Character.Parent = workspace.Ingame end t=100 repeat t = t-1 s.Value = t.." Seconds Left" wait(1) until t ==0 or vals.Winner.Value ~= "" if vals.Winner.Value ~= "" then s.Value = vals.Winner.Value.. "Has Won!" vals.Winner.Value = "" else s.Value = "No One Has Won!" end wait(3) local ingame = workspace.Ingame:GetChildren() for i =1,#ingame do local plr = game.Players:GetPlayerFromCharacter(ingame[i]) plr:LoadCharacter() workspace[curnum]:Destroy() end end
the proble according to output is in line 47
Simply check if the player exists, and their character:
if plr and plr.Character then -- load character here end
for i =1,#ingame do if game.Players:findFirstChild(ingame[i].Name) then ... end