Hello there users of devforum. I am making this script where an enemy team cannot go through a metal detector and if done so it will alarm the metal detector. Though I got this part done. I am making a way for the enemy team to hack it and be able to go through it. It has been semi-completed but whenever the hack is fixed it does the following.
As you can tell it starts to play both the alarm and the sort of pass through signal and debounce wont work as well. Ideas?
Sorry for not getting back to this but it doesn’t work now.
importantbrick:GetPropertyChangedSignal("BrickColor"):Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if ishacked == false and not hackeddebounce then
ishacked = true
hackeddebounce = true
TouchPart.Touched:Connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.TeamColor == BrickColor.new("Lily white") then
Alarm.BrickColor = BrickColor.new("Lime green")
script.Parent.DetectedAllie:Play()
script.Parent.DetectedAllie.Looped = false
task.wait(5)
Alarm.BrickColor = BrickColor.new("Neon orange")
end
task.wait(1)
debounce = false
hackeddebounce = false
ishacked = false
end)
end
end
end)
As in if your in enemy team it doesn’t even scan you, nor is it printing an error.