Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Reset GUI Issue?

I'm trying to make a reset GUI and I don't think it's working properly

function onClicked(click)
script.Parent.Parent.Parent.Parent.Parent.Players.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Down:connect(o­nClicked)

1 answer

The gui would have to be a textbutton for this to work. Make sure it is a textbutton and instead of doing script.Parent.Parent.Parent.Parent.Parentyou could do it much easier by making the script a localscript(if it isn't already) and setting the code as this:

function onClick()
	game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Health = 0
end

script.Parent.MouseButton1Down:connect(onClick)

You also don't need to include a parameter for the function because you aren't using it.

1 comment

0

Thank you. It worked.

This discussion is preserved as it was. New answers, comments, and votes are closed.