So I want to make a script which will pop a GUI up whenever someone respawns.FE is enabled, I've made the script but it doesn't seem to work for some reasons(Not popping up even when someone spawns first time)

These are inside the StarterPack(Might be the issue)

Script

local Players = game:GetService("Players")
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("GiveGui")


function onPlayerAdded(player)
	RemoteEvent:FireClient()
end
	
Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(onPlayerAdded)
end)

Local Script

local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("GiveGui")

RemoteEvent.OnClientEvent:Connect(function(player)
	local gui = game:GetService("ReplicatedStorage"):WaitForChild("Natures"):Clone()
	gui.Parent = player.PlayerGui
	gui.Enabled = true
end)

Thank you!

8 comments

0

i would do some sort of :PlayerAdded kinda thing :/

0

Also why make it FE if only the player will see it

0

oops sorry i realized you did do player added sorry

0

Didn't I do a 'PlayerAdded kinda thing'?

0

sorry

0

In the script, shouldn't you be specifying which player you need to FireClient to? The first argument should tell the server which player you're firing the remote event to, but yours is empty.

0

I mean parameter not argument

0

Still won't work.