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

How can i make the player change his body size by eating something?

Asked by
DashDQ 17
5 years ago
Edited 5 years ago

How can i make the player change his body size to become bigger in a simulator just like in Fat Simulator where the player has an bigger tummy if he eats food?

I searched on youtube but nothing.Do i have to change the player and add him another object to group it with him or something like that?Because i only need to know how to change his witdhs torso when he eats.

Any help is good!

2 answers

Log in to vote
0
Answered by 5 years ago

You have to change the character scaling. An easy way to do this is using the HumanoidDescription system as shown here: https://developer.roblox.com/en-us/articles/humanoiddescription-system#change-an-existing-character-s-scale

0
I know how to do for height. I need for width! DashDQ 17 — 5y
0
Look again, there's more than one property you can change regarding scaling User#834 0 — 5y
Ad
Log in to vote
0
Answered by
Nckripted 580 Moderation Voter
5 years ago

Inside the tool, once they are done with the animation for eating it, add this code:

01local humanoid = script.Parent.Parent:FindFirstChild("Humanoid")
02local playerWidith = humanoid:FindFirstChild("BodyWidithScale")
03local playerHeight = humanoid:FindFirstChild("BodyHeightScale")
04local playerDepth = humanoid:FindFirstChild("BodyDepthScale")
05local playerHead = humanoid:FindFirstChild("HeadScale") --Remove this if you want shrunken heads >:)
06 
07if playerWidith and playerHeight and playerDepth and playerHead then --Check just in case
08    playerWidith.Value = playerWidith.Value + 1
09    playerHeight.Value = playerHeight.Value + 1
10    playerDepth.Value = playerDepth.Value + 1
11    playerHead.Value = playerHead.Value + 1
12else
13    local player = script.Parent.Parent:GetPlayerFromCharacter()
14    player:Kick() --They are likely a hacker, so kick them
15end

If you ever want to restore the character to the originial size, add:

01local humanoid = script.Parent.Parent:FindFirstChild("Humanoid")
02local playerWidith = humanoid:FindFirstChild("BodyWidithScale")
03local playerHeight = humanoid:FindFirstChild("BodyHeightScale")
04local playerDepth = humanoid:FindFirstChild("BodyDepthScale")
05local playerHead = humanoid:FindFirstChild("HeadScale") --Remove this if you want shrunken
06 
07playerWidith.Value = 1
08playerHeight.Value = 1
09playerDepth.Value = 1
10playerHead.Value = 1

Answer this question