Results 1 to 2 of 2

Thread: If attacking monster for x seconds make alarm

  1. #1
    Normal User random's Avatar
    Join Date
    Jun 2012
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5

    If attacking monster for x seconds make alarm

    ppl dont like us botter and i didnt find working one so please help

  2. #2
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    Code:
    local LAST_CREATURE_ID, STARTED_ATTACK = 0, 0 -- dont edit
    local TIME = 60 -- seconds
    
    while (true) do
    	if (LAST_CREATURE_ID ~= target.id) then
    		LAST_CREATURE_ID, STARTED_ATTACK = target.id, timems
    	elseif (timems - STARTED_ATTACK >= TIME*1000) then
    		playsound("alert.wav")
    		break
    	end
    	
    	wait(100)
    end
    Credits to Sirmate
    Last edited by soder; 09-19-2012 at 05:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •