Simple but weird problem with TextButton.Activated that does not work

Hello everyone, for some reason I have this weird problem where a text button does not want to activate. It looks so simple but I can’t find it for some reason.

local StartMenu = game.StarterGui.Menu.StartMenu
local StartButton = StartMenu.StartButton


print("Start")
SpawnButton.Activated:Connect(function()
	print("pressed")
end)

print("End")

For some reason it prints out both Start and End but not pressed

2 Likes


(Source: StarterGui | Documentation - Roblox Creator Hub)

The connection is there, but not on the right object.

Local script

local player = game:GetService("Players").LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

local StartMenu = playerGui:WaitForChild("Menu"):WaitForChild("StartMenu")
local StartButton = StartMenu:WaitForChild("StartButton")

SpawnButton.Activated:Connect(function()
	print("pressed")
end)

The GUI can be accessed on the server as well, although screen UI should be handled locally in most cases.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.