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

When you click the button, you turn small, but it doesnt want to work?

Asked by
iDevity -2
6 years ago

when you click the button (gui) it makes you small

function onButtonClicked() local Character = game.Players.LocalPlayer local Humanoid = Character:FindFirstChild('Humanoid')

if Humanoid then
    local HEAD = Humanoid:FindFirstChild('HeadScale')
    local BodyWidthScale = Humanoid:FindFirstChild('BodyWidthScale')
    local BodyHeightScale = Humanoid:FindFirstChild('BodyHeightScale')
    local BodyDepthScale = Humanoid:FindFirstChild('BodyDepthScale')

    if HEAD then
        HEAD.Value = HEAD.Value - 0.7
        BodyDepthScale.Value = BodyDepthScale.Value - 0.7
        BodyHeightScale.Value = BodyHeightScale.Value - 0.7
        BodyWidthScale.Value = BodyWidthScale.Value - 0.7
    end
end
end

script.Parent.MouseButton1Click:connect(onButtonClicked)

' local Character = game.Players.LocalPlayer ' on that, 'player' is not found

0
You should probably start by defining the "Humanoid" and also probably tell us where the heck local Character is? Because you posted half of your script greatneil80 2647 — 6y
0
1.Please post the whole script that woudl help us all alot Lolamtic 63 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

I can't tell you whats wrong because you didn't post the whole script

MAKE SURE ITS IN A LOCALSCRIPT!!! THE SCRIPT WITH A HUMAN ON IT!!!

short and simple script :

script.Parent.MouseButton1Click:connect(function()
  local Humanoid = game.Players.LocalPlayer.Character:FindFirstChild('Humanoid')
   Humanoid.HeadScale.Value = Humanoid.HeadScale.Value - 0.7
   Humanoid.BodyDepthScale.Value =  Humanoid.BodyDepthScale.Value - 0.7
   Humanoid.BodyHeightScale.Value =  Humanoid.BodyHeightScale.Value - 0.7
    Humanoid.BodyWidthScale.Value =  Humanoid.BodyWidthScale.Value - 0.7
end)

Longer script :


script.Parent.MouseButton1Click:connect(function() local Humanoid = game.Players.LocalPlayer.Character:FindFirstChild('Humanoid') if Humanoid then local HEAD = Humanoid:FindFirstChild('HeadScale') local BodyWidthScale = Humanoid:FindFirstChild('BodyWidthScale') local BodyHeightScale = Humanoid:FindFirstChild('BodyHeightScale') local BodyDepthScale = Humanoid:FindFirstChild('BodyDepthScale') if HEAD then HEAD.Value = HEAD.Value - 0.7 BodyDepthScale.Value = BodyDepthScale.Value - 0.7 BodyHeightScale.Value = BodyHeightScale.Value - 0.7 BodyWidthScale.Value = BodyWidthScale.Value - 0.7 end end end)
Ad

Answer this question