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

Why does this function not work properly? [SOLVED]

Asked by 5 years ago
Edited 5 years ago

I've tried making a function that makes the localplayer grow but it doesn't get invoked.

wait(3)
local plr = game.Players.LocalPlayer
local pack = plr.Backpack
local hum = plr.Character.Humanoid
local gui = plr.PlayerGui
local value = gui.GUI.sizebox.size

local function ChangePlrSize(val)
    hum.BodyHeightScale.Value = val * 1
    hum.BodyWidthScale.Value = val * 1
    hum.BodyDepthScale.Value = val * 1
    hum.HeadScale.Value = val * 1
end

value.Changed:Connect(function(stat)
    if stat == "Value" then
        if value.Value >= 11 then
            value.Value = 10
        end
        ChangePlrSize(value.Value)
    end
end)

If anyone knows how to help please tell me.

0
You dont need to use if stat == "Value" then, you can only use .Changed event. yHasteeD 1819 — 5y
0
Thank you! That fixed it. NoLife_David 1 — 5y

Answer this question