i did this script to see if one of the models are gone but it isnt working
if Model2.Bluespawns == false then print ("Red won") TextLabel.Parent = ScreenGui TextLabel.Size = UDim2.new(0,150,0,50) TextLabel.Position = UDim2.new(0,125,0,0) ScreenGui.Parent = game.StarterGui TextLabel.Text = "Red won" end if Model2.Redspawns== false then print("Blue won") TextLabel.Parent = ScreenGui TextLabel.Size = UDim2.new(0,150,0,50) TextLabel.Position = UDim2.new(0,125,0,0) ScreenGui.Parent = game.StarterGui TextLabel.Text = "Blue won" end
Hello, SLENDERMANCLONE!
Try this (EDITED AGAIN) script:
local Model2 for i,part in pairs(game.Workspace:GetDescendants()) do if part.Name == "Bluespawns" or part.Name == "Redspawns" then Model2 = part.Parent break end end while wait() do if not Model2:FindFirstChild("Bluespawns") then print ("Red won") for i,plr in pairs(game.Players:GetChildren()) do ScreenGui = Instance.new("ScreenGui") TextLabel = Instance.new("TextLabel") TextLabel.Parent = ScreenGui TextLabel.Size = UDim2.new(0,150,0,50) TextLabel.Position = UDim2.new(0,125,0,0) ScreenGui.Parent = plr.PlayerGui TextLabel.Text = "Red won" wait(10) ScreenGui:Destroy() end elseif not Model2:FindFirstChild("Redspawns") then print("Blue won") for i,plr in pairs(game.Players:GetChildren()) do ScreenGui = Instance.new("ScreenGui") TextLabel = Instance.new("TextLabel") TextLabel.Parent = ScreenGui TextLabel.Size = UDim2.new(0,150,0,50) TextLabel.Position = UDim2.new(0,125,0,0) ScreenGui.Parent = plr.PlayerGui TextLabel.Text = "Blue won" wait(10) ScreenGui:Destroy() end end end
Good luck with your games!
Try this
local bluespawn = Model2:FindFirstChild("Bluespawns") local redspawn = Model2:FindFirstChild("Redspawns") if bluespawn then print("Red won") TextLabel.Parent = ScreenGui TextLabel.Size = UDim2.new(0,150,0,50) TextLabel.Position = UDim2.new(0,125,0,0) ScreenGui.Parent = game.StarterGui TextLabel.Text = "Red won" end if redspawn then print("Blue won") TextLabel.Parent = ScreenGui TextLabel.Size = UDim2.new(0,150,0,50) TextLabel.Position = UDim2.new(0,125,0,0) ScreenGui.Parent = game.StarterGui TextLabel.Text = "Blue won" end