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
4 years ago
Edited 4 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 4 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 — 4y
0
Look again, there's more than one property you can change regarding scaling User#834 0 — 4y
Ad
Log in to vote
0
Answered by
Nckripted 580 Moderation Voter
4 years ago

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

local humanoid = script.Parent.Parent:FindFirstChild("Humanoid")
local playerWidith = humanoid:FindFirstChild("BodyWidithScale")
local playerHeight = humanoid:FindFirstChild("BodyHeightScale")
local playerDepth = humanoid:FindFirstChild("BodyDepthScale")
local playerHead = humanoid:FindFirstChild("HeadScale") --Remove this if you want shrunken heads >:)

if playerWidith and playerHeight and playerDepth and playerHead then --Check just in case
    playerWidith.Value = playerWidith.Value + 1
    playerHeight.Value = playerHeight.Value + 1
    playerDepth.Value = playerDepth.Value + 1
    playerHead.Value = playerHead.Value + 1
else
    local player = script.Parent.Parent:GetPlayerFromCharacter()
    player:Kick() --They are likely a hacker, so kick them
end

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

local humanoid = script.Parent.Parent:FindFirstChild("Humanoid")
local playerWidith = humanoid:FindFirstChild("BodyWidithScale")
local playerHeight = humanoid:FindFirstChild("BodyHeightScale")
local playerDepth = humanoid:FindFirstChild("BodyDepthScale")
local playerHead = humanoid:FindFirstChild("HeadScale") --Remove this if you want shrunken 

playerWidith.Value = 1
playerHeight.Value = 1
playerDepth.Value = 1
playerHead.Value = 1

Answer this question