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

How would I make this delete permanently in my local script?

Asked by 8 years ago

I already have the delete script, but how would I make the delete permanent? For example, when I click the button, it deletes it, then when you die it just comes back up. I wish for it to STAY deleted until the player rejoins. Here's the local script:

local frame=script.Parent.Parent.Parent:WaitForChild("Frame")

script.Parent.MouseButton1Down:connect(function()
    frame.Visible=not frame.visible
script.Parent:Destroy()

end)

1 answer

Log in to vote
0
Answered by 8 years ago

Don't put it in StarterGui

Instead, have it in ServerStorage and have a script clone it into the Player when they join, like

game.Players.PlayerAdded:connect(function(p)
game.ServerStorage.YourGuiHere:Clone().Parent = p:WaitForChild("PlayerGui")
end)

woof woof
Ad

Answer this question