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

Saving bodyscale when they reset?

Asked by 6 years ago

Basically i have this roleplay game.

When you go through a "kids" portal. It sizes your bodyscale smaller then a adult size.

But when they reset, it wont save and it will go to default scaling size.

How can i prevent this? or make a script to stop it.

1 answer

Log in to vote
0
Answered by
dispeller 200 Moderation Voter
6 years ago

You could use the GetPlayerFromCharacter function to get the player of whoever touched the portal, and then clone a script that re-resizes them into the StarterGear folder of their player.

so something like

script.Parent.Touched:connect(function(hit)

    local hitPlayer = game.Players:GetPlayerFromCharacter(hit.Parent)

    if hitPlayer then

        local rs = script.ResizeScript:Clone()

        rs.Parent = hitPlayer.StarterGear

        -- stuff to resize the player here as well so they get resized before they die as well

    end

end)

That way, when they respawn, they get resized again.

0
That's a little too complex. Couldn't I just add a localscript in starterplayerscript and go from there. If so, it does not work and it gives no error at all. User#19328 0 — 6y
Ad

Answer this question