this is my script
local name = game.Workspace.NPCS.Meliodas.Name --The NPC humanoid is called zombie too
if name == ("Meliodas") then --Meliodas is the name of the NPC
game.Workspace.MW.CanCollide = true -- MW is the wall
end
this is my script
local name = game.Workspace.NPCS.Meliodas.Name --The NPC humanoid is called zombie too
if name == ("Meliodas") then --Meliodas is the name of the NPC
game.Workspace.MW.CanCollide = true -- MW is the wall
end
workspace.MW.Touched:Cinnect(function(hit)
local hum = hit.Parent.Humanoid
if hum then
if hum.Parent.Name == "Meliodas" then
workspace.MW.CanCollide = true
else
workspace.MW.CanCollide = false
end
end
end)
Put this ServerScript in the workspace
May I ask why in workspace instead of server script service?
Typo on line 1, you wrote 'Cinnect'.
Because the script runs on items that are in the workspace. But i think you can put it inside the server script service too
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
What?
is that the full script? Cuz I don't understand how that will keep an NPC from leaving a certain area, u could use a region3 if it's a cuboid.