the problem im having, im using datastore 2 but tweaked a little bit, but the loadup always messes up because its thinking its a boolean value when its a number value?
local Players = game:GetService("Players")
local DataStore2 = require(game.ReplicatedStorage.DataStore2) -- This is the Module we need I will post it in Description
local Settings = require(game.ReplicatedStorage:FindFirstChild("Settings"))
DataStore2.Combine("DoneTest","Cash","Bank","EyeColor","Hair","Shirt","Pants","Tattoo","HairColor","SkinColor","FirstName","LastName","Gender","Camo","PrisonTime","Arrested","Face","Fish Caught","CarColor","InteriorColor","InteriorWalls","ExteriorWalls","GunPermit","GymMembership","Slot1","Slot2","Slot3","Slot4")
game.ReplicatedStorage:FindFirstChild("Remotes"):FindFirstChild("ToDatastore").OnServerEvent:Connect(function(plr,gui)
print("got first event")
local gui = gui
for i,v in pairs(Settings) do
wait(0.1)
local datastore = DataStore2(i,plr)
local where = v.Where
if v.Where ~= "Player" then
if plr:findFirstChild(v.Where) then
where = plr[v.Where]
else
local folder = Instance.new("Folder",plr)
folder.Name = v.Where
where = folder
end
end
if v.Where == "Player" then
where = plr
end
--// Creates the Value
local val = Instance.new(v.What,where)
val.Name = i
val.Value = v.Value
dotest(plr,val,gui)
--// Loading
if datastore:Get() ~= nil then ---- Line where messes up
val.Value = datastore:Get()
end
--//Saving
val.Changed:connect(function()
datastore:Set(val.Value)
print("saved players value")
end)
print("fart")
end
end)
print("fart3")
function dotest(plr,val,gui)
if val.Name == "DoneTest" then
local typeofe = "StartIntro"
gui.Event:FireClient(plr,typeofe)
gui = nil
print("sent 2nd event")
else
end
end