#why is my script ignoring the :destroy()?
1 messages · Page 1 of 1 (latest)
repeat wait() until #game.Players:GetPlayers() > 0
function message(text)
local msg = Instance.new("ScreenGui", game.StarterGui)
local textr = Instance.new("TextLabel", msg)
textr.Size = UDim2.new(1,0,2,0)
textr.Position = UDim2.new(0,0,-0.5,0)
textr.BackgroundTransparency = 0.5
textr.TextSize = 45
msg.Name = "GameMessage"
textr.Text = text
end
function endmessage()
for i,v in game.Players:GetChildren() do
print(v)
local gun = game.Lighting.Pistol:Clone()
gun.Parent = v.Backpack
end
if game.StarterGui:WaitForChild("GameMessage") ~= nil then
game.StarterGui:WaitForChild("GameMessage"):Destroy()
else
return
end
end
message("hello")
wait(3)
endmessage()
lelelele
It's not ignoring it, it's just that you are getting the starter gui and not the playergui