Use a remote event to fire to the client.
local gui = game:GetService("ReplicatedStorage").Gui
local showGui = Instance.new("RemoteEvent",gui.Parent)
showGui.Name = "ShowGui"
local plr = game:GetService("Players").LocalPlayer
showGui.OnClientEvent:Connect(function()
if not plr.PlayerGui:FindFirstChild(gui.Name) then
gui:Clone().Parent = plr.PlayerGui
gui.Enabled = true
end
end)
now to fire to client
if Humanoid.Health == 0 then
local players = game:GetService("Players")
local plr = players[Humanoid.Parent.Name]
game:GetService("ReplicatedStorage"):WaitForChild("ShowGui"):FireClient(plr)
end
Bonus, it works for FE. You're welcome.
1 comment
You are using Starter Gui instead of Player Gui