#Data save problem
1 messages · Page 1 of 1 (latest)
Script that handles stats in general and saving system
Module script that mostly handles the equipping system
ChatGPT, etc..
why?
To try to find a way to fix it, most of times is deceiving, I know
send the code before you used ai?
This is the one I made without AI
I went back from modifications when followed AI steps, so came back like in starting
Cuz AI was making things worse sometimes ngl
Also, just to save you time, I think the important thing from the module is the 1st function, cuz I tried changing a slot from nil to a unit name and it worked when joining in game
I guess just debug it
See if functions are being called and whether data is being written
I kind of tried some of that, but I can try that again
u got api services on right
Yh
The other stats work well
The units rolled are still kept in inventory
Gold and joins stats are saved
???
tbh it looks like the whole code is just written by ai
game:GetService("Players").PlayerRemoving:Connect(function(player)
equippedTowers[player] = nil
end)
im not quite sure what your asking but
your setting the equipped towers to nil?
game:GetService("Players").PlayerRemoving:Connect(function(player)
equippedTowers[player] = nil
end)
Yes, to new players who join the game for the 1st time
?
But after thinking for a while, this might even occur for players that already played the game
did u even write this 🤦♂️
I mean, when a new player joins to the game, he has nothing in stuff
do you understand what this section of code does
game:GetService("Players").PlayerRemoving:Connect(function(player)
equippedTowers[player] = nil
end)
Yes, it cleans the users' equipped units
** You are now Level 4! **
when?
I tried removing that because I thought that might be the problem
When they disconnect
so?
I thought of that too, I removed it to see if the equipment is saved or not, but no
Tbh I don't see the difference with it or without, I'm just going to remove it
u didn't write this 😄 don't lie
I thought it was a good option to avoid to get the server laggy or something
Like when players rejoin many times and accumulates, idk
As you can see, there's a folder with string values that corresponds to the equipped units they are in different slots
And tbh, I'm not really advanced that much in scripting ngl, I'm still learning and trying new techniques
Btw, don't really mind the french comments, I speak french that's why, it's some notes for me to don't forget what part does what incase I forget
yeah uhh
hate to break it to ya but it doesn't save because you din't put a save function
inside the .PlayerRemoving
Ah ok, sorry for late reply, I didn't see your message, don't hesitate to ping me or reply me so I can get the notification, I've also updated the PlayerStats script a bit and seems to work better, there's just an error that appears
This error
From this part of the server script