Basically, when I fly inside the box or jump, it’s just team me like from the playersTeam to Lobby, and from Lobby to playersTeam.
local Part = script.Parent
local LobbyTeam = game.Teams.Lobby
local PlayersTeam = game.Teams.Contesters
local Players = game:GetService("Players")
Part.Touched:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
player.Team = PlayersTeam
end
end)
Part.TouchEnded:Connect(function(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
if player then
player.Team = LobbyTeam
end
end)
Another method I can suggest is to use RunService with workspace:GetPartBoundsInBox() where you can check if the player is within the zone based on CFrame and Size.
which looks something like this (im on mobile so there cld be some typos):
RunService.Heartbeat:Connect(function()
local parts = workspace:GetPartBoundsInBox(CFrame of Zone, Size of Zone)
local PlayersContesting = {}
for _, v in pairs(parts) do
if players:GetPlayerFromCharacter(v.Parent) then
table.insert(PlayersContesting, v)
v.Team = game.Teams.Contesters
end
end
for _, plr in pairs(Players) do
if not table.find(PlayersContesting, plr) then
plr.Team = game.Teams.Lobby
end
end
end)
this works like a check on who is in the zone
edit: i got nothing to do rn and im bored so i thought id suggest some script ideas to help xD
Thank you for your assistance as well! I thought about using the RunService, but I believe there would be lags and other issues, so I am currently using the ZonePlus module, which is simple to use.
thats true but i usually use overlapparams for this get parts then just use a params which refer to my own collision group which is for player character parts only xD