Why does it print "ButtonClicked" before i have pressed the button?
local function FirstOnClick() print("ButtonClicked") end TeleportationButtons.ScreenGui.First.Activated:Connect(FirstOnClick())
When you want to use events you should pass a REFERENCE
to the function, by adding parenthesis you invoke the function instead of referencing it:
Wrong:
TeleportationButtons.ScreenGui.First.Activated:Connect(FirstOnClick())
Correct:
TeleportationButtons.ScreenGui.First.Activated:Connect(FirstOnClick)
try out this:
local function Print(Val) print(Val) end TeleportationButtons.ScreenGui.First.Activated:Connect(Print("Clicked"))