I have two scripts to execute/receive the RemoveEvent which will lead to the GUI being copied into the PlayerGui. The first script is a regular script I placed in the workspace, and it's purpose is to fire the client.
local RemoteEvent = game.ReplicatedStorage.GUIStuff
game.Players.PlayerAdded:connect(function(player)
RemoteEvent:FireClient(player)
end)
Below is the local script I have in StarterPlayerScripts and is meant to receive the fired event and clone the ScreenGui called 'Start' and place it into the PlayerGui.
local RemoteEvent = game.ReplicatedStorage.GUIStuff
local player = game.Players.LocalPlayer
RemoteEvent.OnClientEvent:connect(function()
local gui = game.ReplicatedStorage.Start:Clone()
if (not player.PlayerGui:FindFirstChild(gui.Name)) then
gui.Parent = player.PlayerGui
end
end)
Through printing tests in the output, I've found that the problem lies somewhere in the second script but I don't know where. Anyone know why?

1 comment
a playergui is a local value what would you want to add it server? This is the same script but with GetService and WaitForChild instead, which are good things to add tbh,