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

How do you make a gui that only apears once?

Asked by
istiyak 13
10 years ago

how to make a gui that only apears once and it doesnt come even if you rejoin the game, but it saves every weapon you have, i tryed this:

game.Players.PlayerAdded:connect(function(player) repeat wait() until player --code end)

but it didnt work also tell me where to put the script if you give me one :)

1 answer

Log in to vote
1
Answered by 10 years ago

do this then

function LoadStat(Player, Stat) -- function for Loading the bool
    if pcall(function()  Player:LoadBoolean(Stat.Name) end) then
        return Player:LoadBoolean(Stat.Name)
    else
        return false
    end
end

game.Players.PlayerAdded:connect(function(Player)
    --Other code
    if Player:WaitForDataReady() then -- wait tell Data is ready for use
    local Intro = Instance.new("BoolValue", Player)
    Intro.Name = "Intro"
    Intro.Value = LoadStat(Player, Intro) -- load the intro stat
    end
end)

game.Players.PlayerRemoving:connect(function(Player) 
    if Player.DataReady then
        Player:SaveBool(Player.Intro.Name, Player.Intro.Value) -- saves the intro Structure: :LoadBoolean(Key, Value), Key is the string name and the value is the value you wish to set it as.
    end
end)

after this make a local script and put it in your intro

local Player = game.Players.LocalPlayer
local Intro = Player:WaitForChild("Intro")

if Intro.Value == true then
    script.Parent["FrameName"].Visible = true -- Set "FrameName" as the frame that holds all the intro stuff
else
    script.Parent["FrameName"].Visible = false
end
0
Where do i put the script? istiyak 13 — 10y
0
In the serverscriptservice DragonSkyye 517 — 10y
0
Do i name the Gui Intro? istiyak 13 — 10y
0
I edited it DragonSkyye 517 — 10y
Ad

Answer this question