But whenever I put it into ServerStorage it disappears? Even when I added:
game.Players.PlayerAdded:Connect(function(plr) local Tracker = Instance.new("IntValue") Tracker.Name = "Tracker" Tracker.Parent = plr **local Clone = game.ServerStorage.ScreenGui:Clone() Clone.Parent = plr.PlayerGui** end)
I even tried copy and pasting another screengui into ServerStorage but it messes it up... and when I asked someone I know who develops, they said whenever ROBLOX does update, GUIs won't work. So what am I supposed to do?? I'm still new to this stuff.
Edit: the ** were supposed to bold but I guess something went wrong. Anyways, that was the part I added.
Hello!
First, now that this script works the issue seems to be it disappears if you die.
There are a couple of ways to solve this. We can use an event that detects when the player's character respawns so that you can add the GUI back.
Here is your edited code:
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) -- this will run when character respawns local Tracker = Instance.new("IntValue") Tracker.Name = "Tracker" Tracker.Parent = plr local Clone = game.ServerStorage.ScreenGui:Clone() Clone.ResetOnSpawn = false Clone.Parent = plr.PlayerGui end) end)
To improve this, we can add a Condition Statement
to check if the player already has the GUI to avoid having multiple of the same Gui. To do this, let's name the GUI.
game.Players.PlayerAdded:Connect(function(plr) plr.CharacterAdded:Connect(function(char) -- this will run when character respawns local Tracker = Instance.new("IntValue") Tracker.Name = "Tracker" Tracker.Parent = plr if plr:WaitForChild('PlayerGui'):FindFirstChild('AnyNameHere') then return end -- If there is already a gui called AnyNameHere do not continue basically local Clone = game.ServerStorage.ScreenGui:Clone() Clone.ResetOnSpawn = false Clone.Name = 'AnyNameHere' Clone.Parent = plr.PlayerGui end) end)
Now you can go try!
Hopefully, this helped you.
Best of luck developer!