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

How to make a spawn with Guest morph?

Asked by 10 years ago
game.Players.PlayerAdded:connect(function(player)
    if Name == "Left Leg" then
        for _,v in pairs(Parent:GetChildren()) do
            if v:IsA("CharacterMesh") then
                v:Remove()
            end
        end
    end
end)

How can I get this to work so whenver a player enters they spawn with the basic roblox morph (Guest morph)

1 answer

Log in to vote
4
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
10 years ago

Name is undefined, did you set it to "Left Leg" somewhere above the part of the script you posted? And same with parent. You also want to do it when their character is added.

But if you don't really know, this should work fine (to remove the CharacterMeshes):

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        wait(1);
        local children = character:GetChildren();
        for key = 1, #children do
            local value = children[key];
            if value:IsA("CharacterMesh") then
                value:Destroy();
            end
        end
    end);
end);

Alternatively, you can set the CharacterAppearance property to someone who looks normal, or set the CanLoadCharacterAppearance property to false.

Edit: Fixed a problem with the script.

0
Forgot to mention both of those properties are properties of the player. jakedies 315 — 10y
0
ok thanks, theres to many end though :P NinjoOnline 1146 — 10y
0
Woops I made a mistake, I'll fix it. jakedies 315 — 10y
0
ok cool, testing naows :) NinjoOnline 1146 — 10y
View all comments (9 more)
0
no, still spawn with roboxian 2.9 :/ NinjoOnline 1146 — 10y
0
2.0** NinjoOnline 1146 — 10y
0
It might be the character hasn't fully loaded. Try adding a wait(0.5) before I define the children variable. jakedies 315 — 10y
0
so line 3 have a wait NinjoOnline 1146 — 10y
0
IT WORKS :D Thanks soo much :) NinjoOnline 1146 — 10y
0
just add a wait(1) on line 3 so that others will see the working one :) Thanks :D NinjoOnline 1146 — 10y
0
Alright jakedies 315 — 10y
0
ok cools thanks :D NinjoOnline 1146 — 10y
0
No problem, I'm here to help =P jakedies 315 — 10y
Ad

Answer this question