----game.StarterGui.MaskGUI.Visor.Visible -----
wait(10)
if game.StarterGui.MaskGUI.Visor.Visible == true then
workspace.EnemyTest.CFrame.new(13, 0.5, 49.6)
else
p = game.Players:GetChildren()
for i = 1,#p do
p[i].Character.Head:remove()
end
end
This is a test enemy code for FNAF 2. What this means, is, if an animatronic is in the room, then it waits 10 seconds, if the mask gui image is visible, then the animatronic teleports away to a certain location. If the mask is not on by then, it will kill all players. However, everytime, it seems to kill me, even when the mask is visible and on. If you need the screen gui, I can also show you that, but can anyone help me with this?

1 comment
Just a tip, CFrame uses Angles rather the position.