local Zone = game.Workspace:WaitForChild("Zone") local charactersInZone = {} while true do
local parts = game.Workspace:GetPartsInPart(Zone) local charactersChecked = {}
for i, part in pairs(part) do local humanoid = part.parent:FindFirstChild("Humanoid")
if humanoid then charactersChecked[part.parent] = true end end end for character, v in pairs(charactersChecked) do if not charactersInZone[character] then local forceField = Instance.new("ForceField") forceField.Parent = character forceField.Visible = false
local highlight = Instance.new("Highlight") highlight.Parent = character highlight.OutlineColor = Color3.new(1, 1, 1) highlight.FillTransparency = 1
charactersInZone[character] = true end end for character, v in pairs(charactersInZone) do if not characterChecked [character] then local forceField = character: FindFirstChildOfClass("ForceField") forceField: Destroy()
local highlight = character:FindFirstChildOfClass("Highlight") highlight: Destroy()
charactersInZone[character] = nil end end task.wait(0.1) end
@@chrisandhisfriends9875 This would require modifying the code of the NPC’s themselves to check if the player has a force field. You can check this by using if character:FindFirstChildOfClass(“ForceField”) then
local Zone = game.Workspace:WaitForChild("Zone")
local charactersInZone = {}
while true do
local parts = game.Workspace:GetPartsInPart(Zone)
local charactersChecked = {}
for i, part in pairs(part) do
local humanoid = part.parent:FindFirstChild("Humanoid")
if humanoid then
charactersChecked[part.parent] = true
end
end
end
for character, v in pairs(charactersChecked) do
if not charactersInZone[character] then
local forceField = Instance.new("ForceField")
forceField.Parent = character
forceField.Visible = false
local highlight = Instance.new("Highlight")
highlight.Parent = character
highlight.OutlineColor = Color3.new(1, 1, 1)
highlight.FillTransparency = 1
charactersInZone[character] = true
end
end
for character, v in pairs(charactersInZone) do
if not characterChecked [character] then
local forceField = character: FindFirstChildOfClass("ForceField")
forceField: Destroy()
local highlight = character:FindFirstChildOfClass("Highlight")
highlight: Destroy()
charactersInZone[character] = nil
end
end
task.wait(0.1)
end
Thanks for the vid !
Nice video!
yo ty i needed this
W Channel !
thank you
can u make a gamepass shop in game 1 that if u buy it , it will appear in game 2 or you have that feature in game 2 (like x2 health)
@@GrikGroockFirez :UserOwnsGamepassAsync() should work with gamepasses from other games :)
do weapons kill you in the safe zone?
No they don’t damage you as most weapons use the :TakeDamage() function
when i play the game the zone disappears.Can you help me to see whats the problem ?
anchor the part
How to make it so that npcs don't attack you while in zone?
@@chrisandhisfriends9875 This would require modifying the code of the NPC’s themselves to check if the player has a force field. You can check this by using if character:FindFirstChildOfClass(“ForceField”) then
this did not work>:[