----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?
Line 6 should be erroring.
workspace.EnemyTest.CFrame = CFrame.new(13, 0.5, 49.6)
----game.StarterGui.MaskGUI.Visor.Visible ----- wait(10) if game.StarterGui.MaskGUI.Visor.Visible == true then game.Workspace.EnemyTest.CFrame.new(13, 0.5, 49.6)-- if you use workspace, it Will not work, you need to either use Workspace or game.Workspace else p = game.Players:GetChildren() for i = 1,#p do p[i].Character.Head:Destroy() --Remove Does not work with Some things, Destroy() should work Most of the time. end end
Thats should Cover it Really.
If it still doesn't work tell me.