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

My script to where you click a button it then explodes you isnt working?

Asked by 3 years ago

yeah i just uh reposted this because the last one had alot of typos in it so epic

So i made a small script so when you click a button it explodes and when you hover your mouse over over the button it will print Click it The error is: Players.LordKrox.PlayerGui.ScreenGui.TextButton.LocalScript:5: Expected ')' (to close '(' at column 45), got '.', but when i add the parentheses it says:

Player.LordKrox.PlayerGui.ScreenGui.TextButton.LocalScript:4: Expected identifier when parsing expression, got ')'

The Script is:

1local Player =  game.Players.LocalPlayer
2local ScreenGui = script.Parent
3local TextButton = ScreenGui.Textbutton
4 
5TextButton.MouseButton1Down:Connect(function(   Instance.new("Explosion", Player))
6 
7 
8    TextButton.MouseButtonHover:Connect(function(print("Click it."))
9end)

If you could Help that would be great.

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

u wrote Textbutton in the script. error shows TextButton

and you were missing an end) in the first function.

1TextButton.MouseButton1Down:Connect(function()
2    Instance.new("Explosion", Player)
3end)
4 
5TextButton.MouseButtonHover:Connect(function()
6    print'click it.'
7end)
Ad

Answer this question