I’m trying to make a datastore save whether or not a player has a vehicle. The script is
local DataStoreService = game:GetService("DataStoreService")
local HasMotorBoat = DataStoreService:GetDataStore("HasMotorboat")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
local UserId = Player.UserId
local Currency = HasMotorBoat:GetAsync(UserId)
local HasMotorBoatStats = Instance.new("Folder", Player)
HasMotorBoatStats.Name = "HasMotorBoatStats"
if not HasMotorBoatStats == 1 then
HasMotorBoatStats = 0
end
local HasMotorBoat2 = Instance.new("IntValue", HasMotorBoatStats)
HasMotorBoat2.Name = "HasMotorBoat2"
HasMotorBoat.Changed:Connect(function(NewValue)
HasMotorBoat:SetAsync(UserId, NewValue)
print("ASYNC")
end)
end)
It never prints “ASYNC”. I’m pretty sure I just got one of the two variables messed up, but I couldn’t figure out which one and where.