Events.RebirthEvent.OnServerEvent:connect(function(p) local Data = Storage.GetData(p.UserId) if Data.Fuel >= 1000 then local Trails = Data.Trails Data.Rebirths = Data.Rebirths +1 Data.Speed = Data.Speed +1 Data.Fuel = Data.Fuel -1000 end end)
ERROR: 22:47:09.223 - ServerScriptService.Events:62: attempt to compare number with table
--Other events that work Events.Trailsahundred.OnServerEvent:connect(function(p,cmd, trail) local Data = Storage.GetData(p.UserId) if cmd == 'Buy' then if Data.Coins >= 250 and not FindTrail(Data.Trails,trail) then local Trails = Data.Trails table.insert(Data.Trails,{Name = trail}) Data.Coins = Data.Coins - 250 end elseif cmd == 'Equip' then if FindTrail(Data.Trails,trail) then Data.EquippedT = trail end end end)
Not sure how to fix this. :/
There's a line that you wrote:
local Data = Storage.GetData(p.UserId)
You wrote .GetData instead of :GetAsync(scope) Which is a function and will return a numberic value instead of a table. So instead try to change it to:
local Data = Storage:GetAsync(p.UserId)