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

How can I Add/Remove Health from a player when he clicks on a buttongui?

Asked by
SIayec 7
3 years ago
Edited by DanzLua 3 years ago

How can I Add/Remove Health from a player when he clicks on a button GUI? I have made a script but it doesn't work for some reason


local humanoid = game.Players.LocalPlayer.Character.Humanoid local currentHealth = humanoid.Health game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(key) if key == "N" and script.Parent.Visible == true and script.Parent.Enabled.Value == true then script.Parent.Parent.Parent.Parent.Players.LocalPlayer.Character.Humanoid.Health = 1 end

the script if for a keybind it works the same as a button.

0
keydown is deprecated, refrain from using it sngnn 274 — 3y

Answer this question