game.Players.PlayerAdded:Connect(function(Character)
Character.CharacterAdded:Connect(function()
if game.ReplicatedStorage.TankArmorBought.Value == true then
Plr.Character.Humanoid.MaxHealth = 200
Plr.Character.Humanoid.Health = 200
Plr.Character.Humanoid.WalkSpeed = 10
end
end)
end)
end
end)
end)
and heres the datastore script:
local DSS = game:GetService("DataStoreService")
local DS2 = DSS:GetDataStore("TankArmorBought")
game.Players.PlayerAdded:Connect(function(Plr)
print("Getting")
game.ReplicatedStorage.TankArmorBought.Value = DS2:GetAsync(Plr.UserId)
print("Got Value")
game.Players.PlayerRemoving:Connect(function()
print("Saving")
DS2:SetAsync(Plr.UserId, game.ReplicatedStorage.TankArmorBought.Value)
print("Saved")
end)
end)

2 comments
thanks the leaderstats script is cleaner now but the effects dont save
Are there any errors? And is this a Server Script?