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

In-Game 1.0 body help???

Asked by
Krlos21 45
9 years ago

I want my game to have all players in 1.0 body, but I don't really know where to start looking...

Mainly what I'm asking is for help on how to change the players Packages to the Roblox 1.0 body as soon as they enter the game? Please help I will thank you so much

0
Check edit on answer. Post comment on my answer when you see it. Tkdriverx 514 — 9y

1 answer

Log in to vote
3
Answered by
Tkdriverx 514 Moderation Voter
9 years ago

This is the EXACT code I've used in one of my games before. I only added comments to make it easier to understand what's going on.

-- I recommend making the CharacterAutoLoads false:
game.Players.CharacterAutoLoads = false

game.Players.PlayerAdded:connect(function(player)
    local function checkChild(child)
        if child:isA("CharacterMesh") then -- This is the mesh of the body packages. They are added directly to the character.
            repeat wait() until child.Parent -- What happens is it's trying to remove the child before it actually has a parent, so we need to wait for it. For some reason, the ChildAdded fires before the child really gets added.
            child:remove()
        end
    end

    local function characterSpawned(character)
        for _, child in pairs(character:children()) do
            checkChild(child)
        end

        character.ChildAdded:connect(checkChild) -- When the player first joins, the meshes sometimes take a little time to load. This makes sure none are left out.

        character:WaitForChild("Humanoid").Died:connect(function() -- Handles respawning. Not important to what you are doing.
            wait(5)
            player:LoadCharacter()
        end)
    end

    player.CharacterAdded:connect(characterSpawned)

    wait() -- For some reason, if we load their character instantly, their character doesn't load with their cloting, etc.. So we need to give it a chance to load the avatar asset.
    player:LoadCharacter() -- Loads the character and fires the CharacterAdded event.
end)
0
This goes in LocalScript in Explorer or Players? And thank you Its of good help :) Krlos21 45 — 9y
0
I placed it in a script in explorer and it worked in Roblox Studio but not in the game and also when i tested it in play solo after the first death i would have my same package not the 1.0 help me please :( Krlos21 45 — 9y
0
I am sorry, I will fix that. Also, it should be a regular script in the ServerScriptService or Workspace. Tkdriverx 514 — 9y
0
Thanks so much :) Krlos21 45 — 9y
Ad

Answer this question