Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get rid of models when intermission is on?

Asked by
Xyternal 247 Moderation Voter
3 years ago

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

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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

0
i thought you knew what i meant. what i wanted to do is delete the tanks when the people are in intermission, but in your script it doens't show that if it is intermission, then it happens Xyternal 247 — 3y
0
?? Mister33j 86 — 3y
0
now im a bit confused lol Mister33j 86 — 3y
Ad

Answer this question