Hi Developers
when i was doing the door that kills the enemies
for some reason the door can kill not only enemies but also allies
the door works with the help of humanoid i was looking for a lot of info
I just made an invisible wall. It helped, it’s not convenient.
I wanted only Npc weapons to be killed, but I had to replace which, in players, is it difficult to have them 16? (this is about their weapons 16)
Considering there’s nothing to work off of other than a scenario, it’s hard to help you resolve the issue you’re experiencing. Are you not filtering the users that enter through your doors and checking if they’re permitted to enter?
Use the script to detect whenever a player touches the kill box with the Touched event. Door.KillBox.Touched:Connect(function()
INSERT PLAYER CHECKING AND KILL CODE end)
After that, check if they’re on say red or blue team. If they’re not on the team that the door is supposed to not kill, the player that passed through will die. You can kill them by using Humanoid.Health = 0
Put this into script and put script inside door that does not kill red and test
script.Parent.Touched:Connect(function(h)
if not h.Parent:IsA("Accessory") then
local target = h.Parent:GetPlayerFromCharacter()
if target.TeamColor ~= "Really red" then
h.Parent.Humanoid.Health = 0
end
end
end)
There’s another way where you can insert a Number Value into a player. For example, red = 1 and blue = 2. And the door will check what the value is inside player.