Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to Make Player change body on Entered?

Asked by 10 years ago

when player enters he/she spawns with package.

1 answer

Log in to vote
0
Answered by 10 years ago
function onPlayerChanged(property,player)
if property=="Character" and player.Character then

for i,v in pairs(player.Character:children()) do
if v:IsA("Shirt") or v:IsA("Pants") then
v:Remove()
end
end
-- Insert new clothes here

end
end

function onPlayerEntered(plyr)
plyr.Changed:connect(function(prop) onPlayerChanged(prop,plyr) end)
end

game:service("Players").PlayerAdded:connect(onPlayerEntered)
Ad

Answer this question