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

My LocalScript isn't doing what I want. It doesn't do anything. How do I fix it?

I made a LocalScript in StarterGui -> ScreenGui -> Frame -> TextButton:

if script.Parent.MouseButton1Click then game.Players.LocalPlayer.Character.Humanoid.Health = 0 end

I wanted to make a button on the screen and when you press it you die. I don't know where the problem is and it also didn't give an error. Nothing happened.

1 answer

✓ Accepted answer

It's actually script.Parent.MouseButton1Click:Connect(function()

You don't need to make an if statement.

Here's the script

script.MouseButton1Click:Connect(function()

game.Players.LocalPlayer.Character.Humanoid.Health = 0 end

Many people have done that mistake (including me previously) so don't get the impression that you're horrible at scripting.

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