Ive posted previous forums but im still stuck with this problem i’ve decided to use the zoneplus module as kind of a substitute for getpartsinpart since i thought it would be easier to use but ive been running into some problems
first is the changing of the points when i enter the point it disappears so i thought it successfully changed to another point but it didnt because no other point appeared and when i went over the position of the previous point i get the print “player has exited” which i set for debugging but for some reason the enter part of the zoneplus doesnt work anymore why is that? should i consider using the getpartsinbound? I really want to finish this project
code so far:
local RS = game:WaitForChild("ReplicatedStorage")
--Modules
local zone = require(RS:WaitForChild("Modules"):WaitForChild("Zone"))
local ZonePlrs = require(game.ServerScriptService.Script.PlrsInZone)
local config = require(script.Config)
--Folders
local PointsFolder = workspace.HardPointFolder
local events = RS:WaitForChild("Events")
--Events
local pointChanged = events:WaitForChild("PointChanged")
local pointCaptured = events:WaitForChild("PointCaptured")
--Points
local points = require(game.ReplicatedStorage.Points)
--Points Vars
local activePoint = nil
local captured = true
local capturing = false
local captureProgress = 0
local curPoint = nil
local capturingPlayersCount = 0
local newpoint = nil
local function activatePoint(point)
if activePoint and captured then
activePoint.Trigger.Transparency = 1
activePoint.Trigger.BrickColor = BrickColor.new("White")
activePoint.Display.BillboardGui.Title.BackgroundColor3 = BrickColor.new("White").Color
activePoint.Display.BillboardGui.Enabled = false
captured = false
end
activePoint = point
activePoint:WaitForChild("Trigger").Transparency = 0.65
activePoint.Display.BillboardGui.Enabled = true
curPoint = point
end
local function SelectPoint()
if captured then
local list = {}
for _, v in ipairs(PointsFolder:GetChildren()) do
if v and v ~= curPoint then
table.insert(list,v)
end
end
local index = math.random(1, #list)
activatePoint(list[index])
print("newpoint Selected")
end
end
SelectPoint()
local newpoint = zone.new(curPoint.Trigger)
newpoint.playerEntered:Connect(function(hit)
print( hit.Name.." has entered")
captured = true
SelectPoint()
end)
newpoint.playerExited:Connect(function(hit)
print(hit.Name.." player has exited")
end)
Edit: ive notice that if i remove the function selectpoint() in the entered event it works properly however if i dont put the selectpoint in the entered event it wouldnt exactly be a hardpoint so why is that?