I have searched for so long and I have found many ways to make a Gui pop up but when I test them they show up just once then they don’t show ever again there are no errors when I try to print a message the message shows but still it the Gui doesn’t pop up WHY?!?!?
Here is the script that I use:
script.Parent.Triggered:Connect(function(Player)
local PGui = Player.PlayerGui
PGui.ScreenGui.Frame.Visible = true
end)
[If you follow that post’s solution, you’ll notice that you need a local script]
[If you want to use remotes, it’s a better way, simply do this:]
--Server
script.Parent.Triggered:Connect(function(Player)
game:GetService("ReplicatedStorage").ShowGuiRemote:FireClient(Player)
end)
--Client
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
game:GetService("ReplicatedStorage"):WaitForChild("ShowGuiRemote").OnClientEvent:Connect(function()
Player:WaitForChild("PlayerGui").MyGui.Frame.Visible = true
--OR, if you simply have 'MyGui' close to that localscript, do something:
--Here, I assume you have that local script inside your MyGui
script.Parent.Frame.Visible = true
end)
Also when using prints instead of just printing something like print("this works") try something more in-depth like print(Player) to see if the player shows up each time.
This makes no sense, why would you suggest someone to do a wrong method?, you cannot really keep a local script in server-side objects, it won’t work, and you cannot look into a player gui from a server-sided script
Neither way is recommended either possible for doing this, the only way is a remote event/function
You should learn it quite a bit before performing things such as these, as at starting this might be confusing, but thats based on concept of server/client sides
In these things like doing on server, you should always do a remote event for one side communicatio
How would you do then? you would keep a script in brick, and it does it? Like what your trying to say, remote events are the most basic formes of it, even in DevHub its written that its also used for shop ui as example