I need help with this for a gui.. Script:
function onClicked(click) local plr = script.Parent.Parent.TextBox.Text game.Players.plr.Character.Humanoid.Health = 0 end script.Parent.MouseButton1Down:connect(onClicked)
Please try to answer!
You are actually very very close. The error is on line 3. plr is a string, not a player, so you define that by using []'s.
function onClicked(click) local plr = script.Parent.Parent.TextBox.Text game.Players[plr].Character.Humanoid.Health = 0 --NOTE There is NO period after "Players" end script.Parent.MouseButton1Down:connect(onClicked)
:)