local zauna = game:GetService("DataStoreService"):GetDataStore("Zauna") script.Parent.MouseButton1Click:connect(function(player) local leaderstats = player.leaderstats local zaunapoints = player.leaderstats.Zauna local key = "user_" .. player.userId wait(0.1) zauna:UpdateAsync(key, zaunapoints.Value) end)
I'm really new to Datastores, and I'm really confused with them. I can't really see what I'm doing wrong. I don't know, but maybe the "player" variable doesn't really access the player? Or maybe a capitalization error? I can't really find anything. I really don't know much about datastores. I'm just experimenting because I'm trying to get a working saving script in my game.
Yeah it seems you figured it out. Just remember that MouseButton1Down doesn't give the player. You would use a local script to get the player for GUIs. The use remote events to communicate with the server and save. Good luck!