Screen Gui Button Not Working

I’m looking to create a Tip system. I’m struggling as I’ve made a script to open a UI when a button above a player’s head is pressed, but whenever I press the button above my head the menu is not appearing. I’m not sure if it’s to do with the script itself, it could be, however I was more thinking it might be because the button is in the UI above the person’s head and isn’t just a button on a menu or something. You can probably tell I am pretty clueless.

Images (hopefully these will help)

image

Scripts

local remote = game:GetService("ReplicatedStorage"):WaitForChild("Tip") 

script.Parent.Triggered:Connect(function(player)

remote:FireClient(player)

end)
local remote = game:GetService("ReplicatedStorage"):WaitForChild("Tip") 

remote.Activated:Connect(function()

script.Parent.Visible = true

end)

Thanks!

1 Like

Lookup the API for remote events- Remote Events and Functions | Roblox Creator Documentation
The event handler for receiving client events is remote.OnClientEvent instead of remote.Activated.

1 Like

Thank you, I’ve now changed that, thanks for the correction! It’s still not working though so I’ll keep trying.

Are there any errors in the output? What part isn’t working

When I physically press the button within the game nothing happens. Usually you’d expect it to turn a but darker when clicked for a split second or something when you click it just to indicate it’s been pressed. But when I click it in the game, it acts in the same way as if it were just a text label and nothing happens.

if that’s for the textbutton try
script.Parent.MouseButton1Down:Connect(funtion())

1 Like

Still not working but thank you!

Are there any errors???

Have you tried any print statements to see if the code runs? Where are you scripts located? Note that Localscripts run code on the client, hence won’t run if they are placed somewhere such as ServerScriptService etc

Nope. I don’t think it’s recognised as a button. Usually when hovering over a button the mouse will change but it stays the same.

send a picture of the output so I can see

The first one is parented to the button. The second one is parented to the UI that appears when the button is clicked.

Are you placing the BillboardUI in workspace, or in the playerGui and setting the adornee to the part? The button won’t highlight if the billboard is directly in the workspace, you need to put it in the StarterGui/PlayerGui and set its adornee to the Head

why do you have player there if you don’t use it

try this:

local remote = game:GetService("ReplicatedStorage"):WaitForChild("Tip") 

script.Parent.MouseButton1Down:Connect(function()

remote:FireClient()

end)

Workspace. I’ll try what you said and see if it works, thank you!

Where did you put the script? is there a ProximityPrompt? or is there just a TextButton

the button script:

local remote = game:GetService(“ReplicatedStorage”):WaitForChild(“Tip”)

script.Parent.Triggered:Connect(function(player)
remote:FireClient(player)
end)

the UI script:

local player = game.Players.LocalPlayer
local tipUI = script.Parent

local remote = game:GetService(“ReplicatedStorage”):WaitForChild(“Tip”)

remote.OnClientEvent:Connect(function(targetPlayer)
if targetPlayer == player then
tipUI.Visible = true
end
end)