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

The datastore key is true when I never changed it to true, and its supposed to be false?

Asked by 9 years ago

I'm making a RPG save/load system, and when i'm making the "New Game" button, when someone clicks it, the script in it is supposed to check if the "char" key is false. And if it is continue with making a new game, else if it isn't false then change the "Welcome" text to "Can only have 1 class right now."

Script:

chards = game:GetService("DataStoreService"):GetDataStore("CharMade")

script.Parent.MouseButton1Click:connect(function()
    if chards:GetAsync("char") == false then
        script.Parent.Visible = false
        script.Parent.Parent.Load.Visible = false
        script.Parent.Parent.Welcome.Text = "Choose your class..."
        chards:SetAsync("char", true)
    else
        script.Parent.Parent.Welcome.Text = "Can only have 1 save right now, it will be added in future updates."
        wait(3)
        script.Parent.Parent.Welcome.Text = "Welcome to RPG! If you haven't played this before, please click New Game."
    end
end)
0
(This is a normal script) Operation_Meme 890 — 9y

1 answer

Log in to vote
1
Answered by
RM0d 305 Moderation Voter
9 years ago

try

player = -- insert player path here might be something like script.Parent.Parent.Parent.Parent
if chards:GetAsync("UserFirstTime" .. player.UserId )== false then -- line 04
chards:SetAsync("UserFirstTime".. player.UserId ,true)
0
Still doesn't fix it. Operation_Meme 890 — 9y
0
I don't know its wrong on your end. RM0d 305 — 9y
Ad

Answer this question