I was just trying to make a simple button. But of course the button decides not to work because I probably made a mistake. I am scripting in a local script just putting this out there. Someone please help me.
Code:
--Made By: Troloolooolooll
local button = script.Parent
button.MouseEnter:connect(function()
button.BackgroundColor3(141, 141, 141)
end)
button.MouseButton1Click:connect(function()
local player = game.Players.LocalPlayer
print(player.Name)
end)
button.MouseLeave:connect(function()
button.BackgroundColor3(80, 80, 80)
end)
Edited: I put my gui in a folder. When I took it out of the folder it worked.

7 comments
Thank you, but the fact is the functions aren't even being ran. So like nothing is happenning
Showing entire script, also make sure that your button is visible on the screen, such as in a ScreenGui.
I am showing my entire script. Also the button is visible and active.
When running my script, both in Studio's Test Mode and playing in an actual server using it, the button worked fine. Without the Color3.new phrase inserted into the code, the script just gives the Button 3 numbers, with no idea how to use them.
So do you know what the problem is or?
I was sure the Color3 was the only problem. Did you at least insert the new code to see for yourself?
Yes, I inserted the new code and didn't work, but the problem is that the functions aren't being ran.