any help with my stat saving script?
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
- I put a localscript in workspace
- here is the script below "3." is the script.
3.I have a model named stats in the starterGui and what is within it is "Ninjutsu and "TaiJutsu"
game
starterGui
stats
Ninjutsu
TaiJutsu
--heres the script-
wait(0.5)
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")
2 | game.Players.LocalPlayer.PlayerGui.Ninjutsu.Value = playerRace |
4 | print ( "Nothing to load" ) |
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!