How do I make the part so that if a player enters it, it gives them a ForceField, and when they get out of it, it takes away their ForceField using OverlapParams?
I was going to use Region3 or .Touched but I’ve heard that .Touched don’t work efficiently and Region3 is deprecated.
You can use the module called “ZonePlus” that utilizes overlapparams to create zones very easily. You can read about it here: ZonePlus v3.2.0 | Construct dynamic zones and effectively determine players and parts within their boundaries
Heres a video to demonstrate
Code used in video:
local Container = workspace.Part
local Module = require(game.ReplicatedStorage.Zone)
local Zone = Module.new(Container)
Zone.playerEntered:Connect(function(Plr)
local Shield = Instance.new("ForceField")
Shield.Parent = Plr.Character
end)
Zone.playerExited:Connect(function(Plr)
Plr.Character:FindFirstChildOfClass("ForceField"):Destroy()
end)
I added ZonePlus in ReplicatedStorage but it doesn’t work
Can we do this without using ZonePlus?