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

Why doesn't the character size change?

Asked by 2 years ago
Edited 2 years ago

So I am just making a script for fun, and to practice, it is meant to turn the player into a golden giant, but I have run into a problem, It all works fine, but when I try and change the size of the player, they don't change at all, the values are updating inside of the humanoid, but it doesn't change the size of the character.

local uis = game:GetService("UserInputService")
local char = script.Parent
local pants = char:WaitForChild("Pants").PantsTemplate
local shirt = char:WaitForChild("Shirt").ShirtTemplate
local colours = char:WaitForChild("Body Colors")
local skincolour = colours:Clone()
local transformed = false
local debounce = false
local humanoid = char.Humanoid

local function gold()
    for i, part in pairs(char:GetChildren()) do
        if part:IsA("MeshPart") then
            part.Material = "Metal"
            part.Color = Color3.fromRGB(255,255,0)
            print("Changed to gold")
            if part.Name == "Head" then
                part.face.Transparency = 1
            end
        end
        if part:IsA("Accessory") then
            part.Handle.Transparency = 1
        end
    end
    humanoid.BodyHeightScale.Value = 7
    humanoid.BodyWidthScale.Value = 7
    humanoid.BodyDepthScale.Value = 7
    humanoid.HeadScale.Value = 7
    humanoid.BodyProportionScale.Value = 1.75
    humanoid.BodyTypeScale.Value = 1.75
    char.Shirt:Destroy()
    char.Pants:Destroy()
    transformed = true
end

local function normal()
    for i, part in pairs(char:GetChildren()) do
        if part:IsA("MeshPart") then
            part.Material = "SmoothPlastic"
            print("Changed to normal")
            if part.Name == "Head" then
                part.face.Transparency = 0
                part.Color = skincolour.HeadColor3
            end
            if part.Name == "UpperTorso" or "LowerTorso" then
                part.Color = skincolour.TorsoColor3
            end
            if part.Name == "LeftLowerArm" or "LeftUpperArm" then
                part.Color = skincolour.LeftArmColor3
            end
            if part.Name == "LeftLowerLeg" or "LeftUpperLeg" then
                part.Color = skincolour.LeftLegColor3
            end
            if part.Name == "RightLowerArm" or "RightUpperArm" then
                part.Color = skincolour.RightArmColor3
            end
            if part.Name == "RightLowerLeg" or "RightUpperLeg" then
                part.Color = skincolour.RightLegColor3
            end
        end
        if part:IsA("Accessory") then
            part.Handle.Transparency = 0
        end
    end
    local newshirt = Instance.new("Shirt",char)
    newshirt.ShirtTemplate = shirt
    newshirt.Name = "Shirt"
    local newpants = Instance.new("Pants",char)
    newpants.PantsTemplate = pants
    newpants.Name = "Pants"
    humanoid.BodyHeightScale.Value = 0.9
    humanoid.BodyWidthScale.Value = 0.95
    humanoid.BodyDepthScale.Value = 1
    humanoid.HeadScale.Value = 1
    humanoid.BodyProportionScale.Value = 1
    humanoid.BodyTypeScale.Value = 0.7
    transformed = false
end

uis.InputEnded:Connect(function(key)
    if key.UserInputType == Enum.UserInputType.Keyboard then
        if key.KeyCode == Enum.KeyCode.Q then
            if debounce == false then
                debounce = true
                if transformed == false then
                    gold()
                    wait(0.5)
                    debounce = false
                else
                    normal()
                    wait(0.5)
                    debounce = false
                end 
            end
        end     
    end
end)

Its quite a messy script, but other than the size, it works

0
Is this in a local script or a serverscript? MendozaHM3SBulldog 32 — 2y
0
local, but it changes the actual values inside of the humanoid, just doesn't change the size adieking1 69 — 2y

Answer this question