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

Why won't this gui stats changer work?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
function onClicked(thingy)
    thingy.Character.Humanoid.MaxHealth = 125
    thingy.Character.Humanoid.MaxHealth = 125
    thingy.Character.Humanoid.WalkSpeed = 16
end

script.Parent.MouseButton1Down:connect(onClicked)

This is it. Sorry i just started scripting for like a few months ago

2
What are you trying to do with this script? It would help if you explained what this was (a tool?) and what the idea was to accomplish. BlueTaslem 18071 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago
local p=game.Players.LocalPlayer

script.Parent.MouseButton1Down:connect(function(x,y)
    p.Character.Humanoid.MaxHealth=125
    p.Character.Humanoid.Health=125
    p.Character.Humanoid.WalkSpeed=16
end)
0
thx a lot! supermarioworld323 45 — 10y
Ad
Log in to vote
0
Answered by
iaz3 190
10 years ago

Try using MouseClick instead of MouseButton1Down

For reference

this and this

For the purposes of this answer, i assume you want to get the player who clicked a part.

Answer this question