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)
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)