I'm trying to make a naruto game that has stats and every 0.5 seconds it saves the stats let me give you how the details are of studio I need help knowing where are the errors
local n = game:GetService("DataStoreService"):GetDataStore("Ninjutsu") local t = game:GetService("DataStoreService"):GetDataStore("Taijutsu") while true do wait(0.5) function saveRace(player, ninjutsu) player:SaveNumber("Ninjutsu", ninjutsu) end
function loadRace(player, ninjutsu) local playerRace = player:LoadNumber("Ninjutsu")
if playerRace ~= 0 then game.Players.LocalPlayer.PlayerGui.Ninjutsu.Value = playerRace else print("Nothing to load") end
end end
So I did this but It doesnt save when I reset(Die) or when I rejoin what are the errors? Output doesnt show anything nor the command bar! HELP!
local n = game:GetService("DataStoreService"):GetDataStore("Ninjutsu") local t = game:GetService("DataStoreService"):GetDataStore("Taijutsu") while true do wait(0.5) function saveRace(player, ninjutsu) player:SaveNumber("Ninjutsu", ninjutsu) end function loadRace(player, ninjutsu) local playerRace = player:LoadNumber("Ninjutsu") if playerRace ~= 0 then game.Players.LocalPlayer.PlayerGui.Ninjutsu.Value = playerRace else print("Nothing to load") end end end
Just decided to clean this up if anyone wanted to answer it, I am going to edit this to make it an answer, though.