#why i get this 64 coins error
1 messages · Page 1 of 1 (latest)
Do you have a debounce?
i tried using debounce it didnt fix
so i deleted a part of my script and now its fixed
but its strange because i had to delete stats saving scripts
now im struggliing making the script again i have errors
What's the script?
i just deleted it
gimme few min imma write it again and send
if u can help me
I can try
local dataStore = game:GetService("DataStoreService")
local data = dataStore:GetDataStore("Stats")
game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = plr
local jumpPower = Instance.new("NumberValue")
jumpPower.Name = "Jump Power"
jumpPower.Value = 15
jumpPower.Parent = leaderstats
local wins = Instance.new("NumberValue")
wins.Name = "Wins"
wins.Value = 0
wins.Parent = leaderstats
local coins = Instance.new("NumberValue")
coins.Name = "Coins"
coins.Value = 0
coins.Parent = leaderstats
local jumpPower
local wins
local coins
jumpPower = data:GetAsync(plr.UserId.."-Jump Power")
wins = data:GetAsync(plr.UserId.."-Wins")
coins = data:GetAsync(plr.UserId.."-Coins")
if jumpPower ~= nil then
plr.leaderstats.jumpPower.Value = jumpPower
end
if wins ~= nil then
plr.leaderstats.wins.Value = wins
end
if coins ~= nil then
plr.leaderstats.coins.Value = coins
end
end)
game.Players.PlayerRemoving:Connect(function(plr)
local sucess, errormsg = pcall(function()
data:SetAsync(plr.UserId.."-Jump Power", plr.leaderstats.jumpPower.Value)
data:SetAsync(plr.UserId.."-Wins", plr.leaderstats.wins.Value)
data:SetAsync(plr.UserId.."-Coins", plr.leaderstats.Coins.Value)
end)
end)
this is my leaderstats script
im a beginner so my script may be wrong
but all is supposed to work i dont get it
Why do you declare wins jumpower and coins?
Like the second time
Ure right for no reason but didnt think it would affect code
Bew
Bdw
I changed all code
Now it works
So then ur all good?
I have to admit i got bored and use chatgpt
Yes thanks for your jelp
Well chat gpt is fine if you used it correctly
Like if it can fix something by all means go ahead
Yup itd have been better if id have understood but at least it works
Ask it to explain it to you
Yup even if i think we should try to fix it by ourselves first
Thanks ill
It is very good at explain how things work, I've learned alot with it's help
Thanks