-
I’m trying to make upgrade zones for my game where if a model enters a zone it’s price is increases
-
The zone.itemEntered is not firing when anything enters the zone. partEntered works but it wont detect the model unless I set the models primarypart.Anchored to false.
-
I’ve tried checking the devforum to see if others had the same problem, but I cant find anything that works
-- SERVICES --
local ReplicatedStorage = game:GetService("ReplicatedStorage")
--
-- VARIABLES --
local global = require(script.Parent.Parent.Parent.Global)
local items = global.Items
local zone = global.Zone
local conveyor = {}
local meta = {}
--
-- TYPES --
--
-- PRIVATE --
--
-- PUBLIC --
function conveyor.new(owner, class, model : Model) : global.ConveyorModule
local self = setmetatable(table.clone(class) or table.clone(items.Conveyors[1]), meta)
self.Model = model
if class.Process then
print(model:FindFirstChild("Upgrader"))
local conveyorZone = zone.new(model:FindFirstChild("Upgrader"))
self.Zone = conveyorZone
conveyorZone.itemEntered:Connect(function()
print("hi")
end)
print(conveyorZone.partEntered)
end
return self
end
function meta:Destroy()
warn("destroying")
self.Model:Destroy()
self.Zone:Destroy()
table.clear(self)
self = nil
end
--
return conveyor
The zone(green part):
