this is only half of the script its a 100+ line script but i didnt want to post the whole thing so this is the part i feel is doing the problems
function selectCharacter(person) local chosen = person[math.random(1,#person)] if string.find(tagger.Value,chosen.Name) == nil then if chosen:findFirstChild("ItStatus") ~= nil then chosen:findFirstChild("ItStatus").Value = true end if chosen:findFirstChild("leaderstats") ~= nil then chosen:findFirstChild("leaderstats").Value = 0 end local hum = chosen.Character:findFirstChild("Humanoid") if hum ~= nil then hum.WalkSpeed = 20 end local parts = chosen.Character:GetChildren() for i = 1,#parts do if parts[i].className == "Part" then parts[i].Anchored = false end end wait() local tagscript = chosen.Character:findFirstChild("Torso"):findFirstChild("TagFlee") if tagscript ~= nil then tagscript.Name = "TagIt" end local tagblock = chosen.Character:findFirstChild("TagBlock") if tagblock ~= nil then tagblock.Parent = nil end dubHat(chosen) tagger.Value = tagger.Value..", "..chosen.Name else selectCharacter(person) end end function calculate(char) local characters = char:GetChildren() select = (#characters/5)-((#characters/5)%-1) for i = 1,select do selectCharacter(characters) itcount = itcount + 1 end end
Okay, I will try helping you as best I can on my phone. a tip is instead of keep using if then statements try using if then and or it cuts back line count alot.
Okay I will just make you a script drawing players
function draw(players) max = math.random(1,#players) for i, v in pairs(players) do If i >=max then --blah blah blah end end end function cut() for i,v in pairs(game.Players:GetChildren()) do tabplayers = {} if v ~= nil and v:FindFirstChild("Character") ~= nil then -- variables just use and table.Add(tabplayers,tabplayers[#tabplayers+1],v) end draw(tabplayers) end
This should work but i typed on my iphone so if it doesnt post the errors and il fix it