game.Players.PlayerAdded:Connect(function(plr)
local CloneMe = game.ServerStorage.ClassLoadout:Clone()
CloneMe.Parent = plr.PlayerGui
end)
how do I make it when a player die it clone the gui
game.Players.PlayerAdded:Connect(function(plr)
local CloneMe = game.ServerStorage.ClassLoadout:Clone()
CloneMe.Parent = plr.PlayerGui
end)
how do I make it when a player die it clone the gui
Hi bro,
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterRemoving:Connect(function()
local CloneMe = game.ServerStorage.ClassLoadout:Clone()
CloneMe.Parent = plr.PlayerGui
end) end)
try this.
Hello dude, here this might be what you're looking for!
(It's a localscript which you should put in StarterGui)
local Player = game:GetService("Players").LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
wait(0.25)
character["Humanoid"].Died:Connect(function()
local CloneMe = game.ServerStorage.ClassLoadout:Clone()
CloneMe.Parent = plr.PlayerGui
end)
This is probably not what you're looking for, but if you mean like when the player dies, the GUI doesn't disappear, go into the ScreenGUI's properties and turn ResetOnSpawn off.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
This runs BEFORE the character is removed. It's a much better solution to add this on CharacterAdded