Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can anyone help me with a script that pops up a GUI whenever player respawns?[Solved]

Asked by 6 years ago
Edited 6 years ago

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!

0
i would do some sort of :PlayerAdded kinda thing :/ DatRainbowTee 49 — 6y
0
Also why make it FE if only the player will see it DatRainbowTee 49 — 6y
0
oops sorry i realized you did do player added sorry DatRainbowTee 49 — 6y
0
Didn't I do a 'PlayerAdded kinda thing'? brokenrares 48 — 6y
View all comments (4 more)
0
sorry DatRainbowTee 49 — 6y
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. Pojoto 329 — 6y
0
I mean parameter not argument Pojoto 329 — 6y
0
Still won't work. brokenrares 48 — 6y

Answer this question