So I was trying to code an intermission script, where if if it says Intermission: in the TextLabel, then it would clear all tanks. But for some reason, the script doesn't do as I thought. Any help Appreciated. Thanks!
while true do local Text = game.StarterGui.ScreenGui.TextLabel.Text if Text:find("Intermission:") then local table = game.Workspace:GetChildren() for i,v in pairs (table) do if v.Name == "tank" then v:Destroy() end end end end
add a script in workspace, name it aaa (but why), should look like this
while true do wait(0) local aaa = workspace:FindFirstChild("tank") if aaa then p = script.delete:Clone() p.Parent = aaa p.Disabled = false end end
next, add another script whose parent is the previous script, name it "delete", disable both:
script.Parent:Destroy() --doesnt delete the script lol
and do this to ur game script, idk how to explain lol
--when intermission begins workspace.aaa.Disabled = false
--when intermission ends workspace.aaa.Disabled = true
hope ur game doesn't break