#Remote event destroying array
1 messages · Page 1 of 1 (latest)
Server sees it fine, client gets this:
if i have [1], [2]. etc. no problem. if i have [1].[8], etc, it doesnt send anything after 1.
what should i do here? just fill all slots with just [2] "I AM EMPTY!!!" ?
** You are now Level 5! **
I guess i can just swap around to be
= [count]
so there wont ever be any nil entries
and move maxstack somewhere else because it shouldnt be there anyways
OOOR I can be a hacky piece of shi and just convert the entries into strings before sending and then convert back to numbered again on the client
so i dont have to refactor ..
fuck it im gonna be evil its funny
local function stringifySlots(slots) --THE EVIL HACK IN QUESTION
local result = {}
for index, data in pairs(slots) do
result[tostring(index)] = data
end
return result
end
local function numberifySlots(slots)
local result = {}
for key, data in pairs(slots) do
local numKey = tonumber(key)
if numKey then
result[numKey] = data
end
end
return result
end