It's about checking if a humanoid is killed, it gets deleted. What am I doing wrong?
Here's the script
while true do wait() workspace.TheWallOfFlesh:WaitForChild("Zombie") if workspace.TheWallOfFlesh.Zombie.Health < 1 then workspace.WallOfFlesh:Destroy() workspace.Fleshpart:Destroy() workspace.Fleshpart2:Destroy() workspace.Fleshpart3:Destroy() workspace.Fleshpart4:Destroy() workspace.Fleshpart5:Destroy() workspace.Fleshpart6:Destroy() workspace.Fleshpart7:Destroy() local splode = Instance.new("Explosion") splode.Parent = workspace.TheWallOfFlesh.Head script.Parent.Text = "The Wall of Flesh Has been defeated!" wait() end end
Hello, Jaska!
Are you calling your script from a server script or from a localscript? Your script needs to be called from server and I suggest using .Died event to check when the humanoid died.
Your script would look like that
local Humanoid = workspace.TheWallOfFlesh:WaitForChild("Zombie") Humanoid.Died:Connect(function() for i = 1, 7 do workspace:FindFirstChild("Fleshpart" .. i):Destroy() end local splode = Instance.new("Explosion") splode.Parent = workspace.TheWallOfFlesh.Head script.Parent.Text = "The Wall of Flesh Has been defeated!" wait() end)
If you have any questions, feel free to ask them!