luau
luau copied to clipboard
Free type pack is escaping its module
This is a issue and i cannot send the whole script because it is a secret script. but ill try to send this. USING NEW TYPE SOLVER!
local sources = {
Moderator = {
Name = "Moderator",
Color = Color3.new(1,1,1),
Size = Vector3.one*2,
Speed = 0,
},
ControlRod = {
Name = "ControlRod",
Color = Color3.new(0,0,0),
Size = Vector3.one*2,
Speed = 1,
},
Neutron = {
Name = "Neutron",
Color = Color3.new(0,0,1),
Size = Vector3.one,
Lifetime = 10,
Speed = 20,
FissionSoundId = "rbxassetid://7772739739",
ReactiveTo = --important part of the issue!
this.Sources.UnStableAtom.Name..","..
this.Sources.PoisonAtom.Name..","..
this.Sources.ControlRod.Name
},
StableAtom = {
Name = "StableAtom",
Color = Color3.new(0.5,0.5,0.5),
Size = Vector3.one*2,
},
UnStableAtom = {
Name = "UnStableAtom",
Color = Color3.new(1,0,0),
Size = Vector3.one*2,
ChanceOfSpawning = 50/100,
FissionProducts = {
this.Sources.Neutron,
this.Sources.Neutron,
this.Sources.Neutron,
this.Sources.RadioActiveAtom,
this.Sources.RadioActiveAtom,
{this.Sources.PoisonAtom, 5/100}, --product, chanceOfProduction
},
},
RadioActiveAtom = {
Name = "RadioActiveAtom",
Color = Color3.new(1,1,0),
Size = Vector3.one*2,
Decay = 10,
Speed = 2,
RadioActiveSoundId = "rbxassetid://8009567525",
},
RadiationRay = {
Name = "RadiationRay",
Color = Color3.new(1,0,1),
Size = Vector3.one,
Lifetime = 10,
Speed = 20,
},
PoisonAtom = {
Name = "PoisonAtom",
Color = Color3.new(0,1,0),
Size = Vector3.one*2,
Decay = 10,
},
}
local function AtomFunctionality(child:BasePart)
if (
child.Name ~= sources.StableAtom.Name and
child.Name ~= sources.UnStableAtom.name and
child.Name ~= sources.PoisonAtom.Name
) then return end
local function connect(other:BasePart)
local source = sources[other.Name]
if (not source or source.Name ~= sources.Neutron.Name) then return end
if (not source.ReactiveTo:find(other.Name)) then return end --issue started when i applied this --line of code. so if i remove that if statement then the issue is gone.
this:Fission(child, other)
task.wait()
child.Touched:Once(connect)
end
child.Touched:Once(connect)
end