the 'end' on line 7 is underlined in red saying "Expected '(','{' or <string> got 'end'"
function onRespawn(character) --the function where we change it to wood local c = character:GetChildren() --get all the objects in the character model for i = 1, #c do --do this to every part we find if (c[i].Name ~= "Torso") and (c[i].Name ~= "Head") and (c[i].Name ~= "Humanoid") and (c[i].Name ~= "HumanoidRootPartthen") then c[i]:Destroy end end end function onChildAdded(player) --The function if (player.className == "Player") then --Make sure they're a player player.Changed:connect(--If they're changed function(changedthing)--do stuff before going to the real function if (changedthing == "Character" and player.Character ~= nil) then --make sure the char exists onRespawn(player.Character)--go to the real function end end ) end end game.Players.ChildAdded:connect(onChildAdded)
On line 5 c[i]:Destroy
is missing an ()
on the end.
Edit: Also, you're checking that the name of the Part
isn't equal to "HumanoidRootPartthen"
- I don't think you want the "then"
bit on the end.