What do you want to achieve?
Print a text after the Billboard Gui is clicked.
What is the issue?
Nothing happens, no errors, nothing.
What solutions have you tried so far?
Well, everything I could think of.
Explorer:
MGButtonLocal (Local Script)
local MakeGameButtonEvent = game.ReplicatedStorage:WaitForChild("MakeGameButton")
local player = game.Players.LocalPlayer
local playerGui = player.PlayerGui
local billboardGui = playerGui:WaitForChild("BillboardGui")
local btn = billboardGui.TextButton
btn.MouseButton1Up:Connect(function()
MakeGameButtonEvent:FireServer()
end)
MGButton (Script)
local MakeGameButtonEvent = game.ReplicatedStorage:WaitForChild("MakeGameButton")
MakeGameButtonEvent.OnServerEvent:Connect(function(player)
print("Button clciked")
end)
Okay, I’ll figure out a bit more. Maybe try parenting the localscript to the billboard gui and changing it to this?
local MakeGameButtonEvent = game.ReplicatedStorage:WaitForChild("MakeGameButton")
local billboardGui = script.Parent
local btn = billboardGui.TextButton
btn.MouseButton1Up:Connect(function()
MakeGameButtonEvent:FireServer()
end)
try debugging your code with print statements, this will allow you to narrow down the problem. For example, put a print statement right after you get the remote event, and then one inside the function connected to the MouseButton1Up event.
This indicates that the remote event isn’t firing and as such, the server doesn’t know that the GUI was pressed. Just to confirm, the print you put inside the connected function on the local script works, but the print statement in the server script doesn’t right?
I have done both, but I have actually figured out the issue. The local script was on the wrong place, once I put it under StarterGui it started working.