Code that I need help with:
script:Clone().Parent = script.Parent
wait()
script:Destroy()
Full code:
game.Players.PlayerAdded:Connect(function(plr)
wait(50)
local teams = game:GetService("Teams"):GetTeams()
local teamended
local OutOfRound = {}
local teamio
plr.Character:WaitForChild("Humanoid").Died:Connect(function()
wait()
table.insert(OutOfRound, plr.Name)
local function dothedo()
for _, team in pairs(teams) do
local players = team:GetChildren()
for i = 0, #players do
if players[i] ~= OutOfRound[i] then
else
teamio = false
print(teamio)
end
end
if teamio == false and team.Name == "Killer Bass" then
teamended = "KB"
elseif teamio == false and team.Name == "Screaming Gophers" then
teamended = "SG"
else
wait(1)
print(teamio)
end
end
end
dothedo()
while 1>0 do
wait(2)
if teamended == "SG" then
wait()
game.ReplicatedStorage.SGLost:FireAllClients()
print(1)
elseif teamended == "KB" then
wait()
game.ReplicatedStorage.KBLost:FireAllClients()
print(1)
else
print(1)
end
if teamended ~= "" or nil then
dothedo()
else
script:Clone().Parent = script.Parent
wait()
script:Destroy()
end
end
end)
end)
Is there a better way? I know disabling it is just downright stupid.
For context while 1>0 do is the same as while true do, and my code works.

1 comment
i don't really know what you mean, but you can use return i guess