Hello, i have question: Is it possible to save Vector3 Value? Because i tried and getting error " ServerScriptService.Core:24: bad argument #3 to 'Value' (Vector3 expected, got number)"
Here is code from DataStore:
local Stats = Instance.new('Folder', game.ReplicatedStorage)
Stats.Name = "PlayerStorage"
local DataStore = game:GetService("DataStoreService"):GetDataStore("BangBangStore")
game.Players.PlayerAdded:connect(function(player)
local plrStats = Instance.new('NumberValue', game.ReplicatedStorage.PlayerStorage)
plrStats.Name = player.Name
local plrMoney = Instance.new('NumberValue', plrStats)
plrMoney.Name = "PointsStorage"
local plrScale = Instance.new('Vector3Value', plrStats)
plrScale.Name = "ScaleStorage"
local plrCharacter = Instance.new('StringValue', plrStats)
plrCharacter.Name = "DuckStorage"
local playerCharacter = game.Players:FindFirstChild(player.Name)
if playerCharacter ~= nil then
playerCharacter.CanLoadCharacterAppearance = false
end
if script.Parent.SettingsTab.StatsSave.Value == true then
pcall(function()
local store = DataStore:GetAsync("u_"..player.UserId)
if store then
print("Found data store")
plrMoney.Value = store
plrScale.Value = store
else
print("No data found")
end
end)
end
end)
game.Players.PlayerRemoving:connect(function(player)
local plrStats = game.ReplicatedStorage.PlayerStorage:FindFirstChild(player.Name)
local plrMoney = Instance.new('NumberValue', plrStats)
plrMoney.Name = "PointsStorage"
local plrScale = Instance.new('Vector3Value', plrStats)
plrScale.Name = "ScaleStorage"
local plrCharacter = Instance.new('StringValue', plrStats)
plrCharacter.Name = "DuckStorage"
if script.Parent.SettingsTab.StatsSave.Value == true then
pcall(function()
DataStore:SetAsync("u_"..player.UserId, plrMoney.Value, plrScale.Value)
print("Saved")
end)
end
if plrStats ~= nil then
plrStats:Destroy()
end
end)
Or maybe Vector3.Value can be saved in different values ?

1 comment
I think so. I don't think that error has anything to do with Vector3 not being able to save in data stores. It probably means that you set the value of a Vector3Value to a number. Line 24 says "plrScale.Value = store" Is the "store" variable a Vector3?