Ok so I have this GUI.It shows the players information like currency.So what i want it to do is that I want it to appear when the player clicks on the Button.However,it works in studio.But not in game.When it is tested in game.The output says
Info is not a valid member of playergui
So info is the screengui and what is inside is a frame Which i want it to be visible
I checked it in studio and it was in the right place.I don't know what is wrong.
Local script
script.Parent.MouseButton1Click:connect(function()
game.ReplicatedStorage.IngameinfoGUIHandler:FireServer()
end)
Script
game.ReplicatedStorage.IngameinfoGUIHandler.OnServerEvent:connect(function(player)
local gui = player.PlayerGui.Info
if gui.main.Visible == true then
gui.main.Visible = false
elseif
gui.main.Visible == false then
gui.main.Visible = true
end
end)
Can anyone tell me what is wrong? I don't have a lot of knowledge on filtering enabled

1 comment
I think It should be FireClient() and the Script and Local Script should be swapped around.