Hey, so I am trying to make this button only work when the background transparency is equal to 0, I am having some trouble with that though mainly because I am pretty bad at coding..
Here is the code I am trying to make work for this.
button = script.Parent
if button.BackgroundTransparency = 0 then
tele = game:GetService('TeleportService')
button.MouseButton1Down:connect(function()
local player = game.Players.LocalPlayer
tele:Teleport(2561674732, player)
end)
end
Any help would be appreciated, sorry it's bad...

7 comments
Use a double equal sign '==' when performing a comparison like that.
That also helps, but do you know why it won't work in general?
It doesn't work because of the equal sign, as far as I know.
It says "invalid player to teleport" do you know how to fix this?
Try using a server script and getting the player another way.
Specifically, use a RemoteEvent.
Please put solved in your title [SOLVED]