Linked Source Help

Hey everyone!

I am making a game that uses a lot of one script, so I made it into a linked source. This is the code:

local Module = require(game.ServerScriptService:WaitForChild("Modules"))
local Table = {}
local Number = 1
script.Parent.Touched:connect(function(hit)
if Table[hit.Parent.Name] == nil then
Table[hit.Parent.Name] = true
end
if Table[hit.Parent.Name] then
wait()
else
Module:Finish(Number,hit)
Number = Number + 1
end
end)

If you don’t understand what I am asking, will this work the way it is supposed to?

Like when Number goes up, will it stay that number when used on a different script?

Example

Say there are two scripts, ScriptA and ScriptB
When used on ScriptA, Number goes up to 10, will it still be 10 when used on ScriptB, or be reset or something?

All help is appreciated thanks! :slight_smile:

2 Likes

Yes, data in modules can be seen by other scripts as it is. Also, I’m not sure what you’re trying to do in your touched function but you’re telling it to set a nil to true. So that will likely break your script.

The nil part doesn’t break the script, but I will change it just in case.
Thanks for the help! :slight_smile:

Sure thing, mark solution if it’s solved so others know.

Right, forgot to do that. :joy: