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

How do i make it so my gui stops deleting it self?

Asked by 2 years ago
Edited 2 years ago

Its a script in serverscriptservice so only i can see it. It works but when i reset or die then it deletes it self. CP is the GUI

local allowed = {"jakubiscool5", "Nobody"}

game.Players.PlayerAdded:Connect(function(player)
    for i, v in pairs(allowed) do
        if player.Name ==v then
            script.CP:Clone().Parent = player:WaitForChild("PlayerGui")
        end
    end
end)
0
Please provide us with your scripts for us to be able to help you. NotThatFamouss 605 — 2y
0
In the server script did you do "game.StarterGui.Gui:Destroy()" MarkedTomato 810 — 2y
0
When you're dealing with GUIs you should be using a local script, it makes no sense to use a server script MarkedTomato 810 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
local Players,gui=game.Players,script.CP
local allowed = {"jakubiscool5", "Nobody"}
gui.ResetOnSpawn=false
local function onPlayerAdded(player)
if table.find(allowed,tostring(player))then
wait()gui:Clone().Parent=player.PlayerGui
end
end;Players.PlayerAdded:Connect(onPlayerAdded)
for _,v in ipairs(Players:GetPlayers())do
onPlayerAdded(v)
end
Ad

Answer this question