local DStoreService = game:GetService("DataStoreService") local CashStore = DStoreService:GetDataStore("Cash")
game.Players.CharacterAdded(function(plr)
local MaxHealth = game.Workspace:WaitForChild("player.Name"):WaitForChild("Humanoid").MaxHealth local CashValue = plr:WaitForChild("leaderstats"):WaitForChild("Cash").Value CashStore:SetAsync("plr_"..plr.UserId, CashValue, MaxHealth)
end)
game.Players.PlayerRemoving:Connect(function(plr) local MaxHealth = game.Workspace:WaitForChild("player.Name"):WaitForChild("Humanoid").MaxHealth local CashValue = plr:WaitForChild("leaderstats"):WaitForChild("Cash").Value CashStore:GetAsync("plr_"..plr.UserId, CashValue, MaxHealth) end)
Are you trolling me with that Lua Block?
anyways.
Heres the right way idk how to explain it so.
game.Players.PlayerAdded:Connect(function(player) -- We get the player first player.CharacterAdded:Connect(character) -- Now you can do that lol --stuff end) end)
Simple mistake you should probably go to dev forum instead. But if this works give me my reward lol