Changing a player bundle with scripts

Hey Developers!

I need help making a script, i think it may be simple but i don’t know.

Basically, i need to change the player’s bundle.
I need a way to toggle it on and off, so you can change your bundle and then go back.
An easier way to think of it is an armor, you can put your armor on and then you can remove it.

I need to make it all inside a TextButton.

Can anyone please help me? Thanks. :smile:

1 Like

For R15, you would have to use ReplaceBodyPartR15.

For R6, you can use CharacterMeshes.

3 Likes

That helps me a lot with what i need to do, but it still doesn’t show me exactly how to use it

Also i’m using R15

I mean, how do i use it in a script?

1 Like
local player = game:GetService('Players'):FindFirstChild('cool name here')
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild('Humanoid')

local newUpperTorso = workspace:FindFirstChild('Cool Upper Torso')

local bodyPart = humanoid:GetBodyPartR15(character:FindFirstChild('UpperTorso') -- gets BodyPartR15 enum

humanoid:ReplaceBodyPartR15(bodyPart, newUpperTorso)
1 Like

I still have some doubts,

First what is “Cool name here” and “Cool Upper Torso” supposed to be?

And also do i need to do that for every body part?

1 Like

Cool name here is whatever the player’s name is. Cool upper torso is what the UpperTorso is replaced with.

You have to use :ReplaceBodyPartR15 with every part, yes.

But in that case how would i get the player’s name? I can’t just magically make the script know the player’s name.

And can the uppertorso be a part or something like that? I was pretending on using a roblox bundle.

1 Like

If you’re using remote events (which I assume you would be), you’d just use the .Name property in the first argument on the listener function on the server script.

Pretty sure it can be a part, Roblox uses MeshParts for their bundles anyway.

1 Like