I think you need the bindtoclose function then. Add that in to see if that fixes it.
Added it in, still doesnt work @DarkDanny04 @CherryMolotov, I used @Cameron4009’s BindToClose function
On line 32 you have a ;
on the first value. Instead, try this:
skin1= plr.skins.NoobSkin.Value,
skin2 = plr.skins.BussinessManSkin.Value;
You literally stole that from my mouth
That doesn’t make a difference. You can use commas or semi-colons with tables.
Instead of kicking the player in your bind to close, just simply add a wait(3). Just tested it, and it works with a wait(3) in the bind to close.
Ah, that’s our bad, I never see people use semi-colons to be fully honest, good to know!
When you press enter by accident, go me LOL
doesnt work lol
Joined:
!
Then left and rejoined:
!
Btw the print(“Data Saved Successfully”) still isnt printing something to do with the playerremoving function
I see your mistake now. On line 25 you have have “data.NoobSkin” The table doesn’t have that. Instead, it has “data.skin1”
Just to clear it up, change line 25 and 26 to this:
skin1.Value=data.skin1
skin2.Value = data.skin2
I think i found the problem, you declared the data as skin2 and skin1 and then when loading you do data.NoobSkin and data.BussinessManSkin, try editing that!
Oh lord, I stole your mouth again haha! (Karma is gonna get me)
You could also try to automate the process as i tried to say before i accidentally clicked enter with:
-- when loading
for i, v in pairs(data) do
local value = Instance.new("IntValue", folder)
value.Name = v.Name
value.Value = v
end
-- when saving
for i, v in pairs(plr.skins:GetChildren()) do
data[v.Name] = v.Value
end
It should work, and also make your code a bit cleaner
Hey guess what, IT WORKED! I rejoined after changing the Value to 1 and it saved!
Now to test the BussinessMan one real quick
That worked aswell!
That means I should be able to add another skin into the table if I wanted? Like this?
You can, or you could follow what i said to make it easier, either way, good luck with further progress!
Yep you could do it like that. Be careful with how much data you keep in one table though, because if you have over 180K characters, you will see some errors coming from the datastore.
Thank you so much to everyone who helped me with this, you all are life savers. I’ve learnt so much and now I can make more efficient data stores, Thank guys
You are really welcome!
The forum are here so we could help others, and let them learn from our own knowledge!
We are not here for ourselves, but for others. If you need any other help, you’re more than welcome to HMU on Discord (Maciej#9063) or roblox messages, will gladly help more if (hopefully not) required!
And again, good luck!
BTW. Do not forget to mark any of the messages as solution to your problem, so people don’t think this is some sort of unsolved detective case