local Lvl=p.leaderstats.Lvl--P is a player local Get=Game:GetService("DataStoreService"):GetDataStore("Points"):GetASync(p.Name.."Lvl") if Get then Lvl.Value=Get elseif not Get then Game:GetService("DataStoreService"):GetDataStore("Points"):SetASync(p.Name.."Lvl", 1) Lvl.Value=1 end
Thank you for your time. I'm afraid if I test it I might mess something up, seeing as it saves...
EDIT: Here's the full script. I'd be very grateful if you could read it and let me know if you see any obvious errors.
while not script.Parent.Parent.Parent.Parent.leaderstats.Lvl do wait() end local p=script.Parent.Parent.Parent.Parent local Lvl=p.leaderstats.Lvl local Exp=Instance.new("IntValue") Exp.Parent=script.Parent Exp.Value=0 local Get=Game:GetService("DataStoreService"):GetDataStore("Points"):GetAsync(p.Name.."Lvl") if Get then Lvl.Value=Get elseif not Get then Game:GetService("DataStoreService"):GetDataStore("Points"):SetAsync(p.Name.."Lvl", 1) Lvl.Value=1 end local Goals={50, 100, 250, 500, 750, 1000, 2500, 5000, 10000} function Raise() for i, v in ipairs(Goals) do if Exp.Value==v then Game:GetService("DataStoreService"):GetDataStore("Points"):IncrementAsync(p.Name.."Lvl") Lvl.Value=i script.Parent.Bar.Size=Udim2.new(0, 0, 0, 20) Exp.Value=0 end end if Exp.Value~=0 then script.Parent.Bar.Size=Udim2.new(0, 140/Exp.Value, 0, 20) end end while true do wait(3) Exp.Value=Exp.Value+1 Raise() end
Closed as Not Constructive by User#2
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?