Following yesterday, my script successfully respawns the player, but now my model isn't get deleted.
game.Players.PlayerAdded:Connect(function(player) local admin = game.ReplicatedStorage.Status while true do if admin.Value == "Intermission" then player.RespawnLocation = game.Workspace.Lobby local trees = workspace:FindFirstChild("car") local treeChild = trees:GetChildren() for I,v in pairs(treeChild) do if v.Name == "car" then v:Destroy() end end else player.RespawnLocation = game.Workspace.Main end wait(0.5) end end)
What is my error?
are you looking for a child inside of car called 'car', or are you looking for the car itself?
game.Players.PlayerAdded:Connect(function(player) local admin = game.ReplicatedStorage.Status while true do if admin.Value == "Intermission" then player.RespawnLocation = game.Workspace.Lobby for i, v in pairs(workspace:GetChildren()) do if v.Name = "car" then v:Destroy() end end else player.RespawnLocation = game.Workspace.Main end wait(0.5) end end)