the 'end' on line 7 is underlined in red saying "Expected '(','{' or 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)

1 comment
Lol, didnt see that last part...