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
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.