You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve?
I’ve been making projectile engine module where script can pass properties into module to create projectile that simulates physics and other stuff -
What is the issue?
When passing properties in single thread example: shotgun fires 6 bullets, but when it passes through the engine one bullet simulates but 6x faster while the rest is frozen in place -
What solutions have you tried so far?
I’ve been looking at how to separate function, self and other stuff but i couldn’t find solution as i could not find with one thread function passing same table in module.
-- Server script (example)
local pro = require(script.Projectilee)
for i=1,4 do
-- // 4 different bullets
pro.fire({i})
end
-- Module
local list = {}
engine.fire = function(set)
local bullet = Instance.new("Part")
set[2] = bullet -- // it should be different in new fire function
table.insert(list,set)
print(list) -- // each table should have different part, and number
end
I started using modules recently to ease up development and been figuring out with shared source and difference, but i’ve been dealing with this problem 2 days ago.