You are running the RemoteEvent in a wrap of two PlayerAdded events? It will absolutely not work because PlayerAdded event will never fire in PlayerAdded signal. It is surely complicated but it is redundant to do so, and it will not work.
You can consider putting the FireClient event outside, since you already have a player parameter in the first PlayerAdded event, you can just fire it directly with the parameter.
Also, server does not have Players.LocalPlayer. You are going to get it using PlayerAdded and get the parameter. Where you already have it so you can remove the line.
Going to the LocalScript, I've noticed a problem is that if you are not in the Owner table, you are going to yield the WaitForChild from the ReplicatedStorage, and never get a respond and return a warning.
I'd recommend you put RemoteEvent inside ReplicatedStorage first. That will be more simpler.
Last problem, and this is from the LocalScript. You never assigned a parameter for player in the OnClientEvent function. Which will make an error "Arguments 1 missing or nil". To fix this, you need to assign the player parameter into the function. Also another problem is you are trying to clone ScreenGui into LocalPlayer? I believe you meant making the GUI clones to the player who have ran the RemoteEvent.
Server Script:
01 | local Owners = { "SkyFume" } |
11 | game.Players.PlayerAdded:Connect( function (Player) |
12 | for i, v in pairs (Owners) do |
13 | if Player.Name = = v then |
15 | local welcomePlayerEvent = game:GetService( "ReplicatedStorage" ).welcomePlayerEvent |
17 | welcomePlayerEvent:FireClient(Player) |
Client Script:
01 | local welcomePlayerEvent = ReplicatedStorage.welcomePlayerEvent |
03 | local function onWelcomePlayerFired() |
04 | local Players = game:GetService( "Players" ) |
05 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
07 | local player = Players.LocalPlayer |
08 | local playerGui = player:WaitForChild( "PlayerGui" ) |
09 | local ScreenGui = script.Parent.ScreenGui |
11 | ScreenGui.Parent = playerGui |
14 | welcomePlayerEvent.OnClientEvent:Connect(onWelcomePlayerFired) |