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

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

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:

local Player =  game.Players.LocalPlayer
local ScreenGui = script.Parent
local TextButton = ScreenGui.Textbutton

TextButton.MouseButton1Down:Connect(function(	Instance.new("Explosion", Player))
	
	
	TextButton.MouseButtonHover:Connect(function(print("Click it."))
end)

If you could Help that would be great.

1 answer

✓ Accepted answer

u wrote Textbutton in the script. error shows TextButton

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

TextButton.MouseButton1Down:Connect(function()
	Instance.new("Explosion", Player)
end)

TextButton.MouseButtonHover:Connect(function()
	print'click it.'
end)

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