bombs_disarmed = 0 pressed = 0 gate_unlocked = 0 --change this to match how long in seconds the call conversation is local call_duration = 4 local state = "call" function phone_demand_init_name(e,name) weapon_name[e] = tonumber(name) end function phone_demand_main(e) Hide(e) CollisionOff(e) if state == "call" then if GetPlayerDistance(e) < 500 then PlaySoundIfSilent(e,0) Prompt("Answer the phone *e*") if GetInKey() == "e" then StartTimer(e) PlaySound(e,1) state = "call2" end end elseif state == "call2" then Prompt("Disarm the bombs") if GetTimer(e) > call_duration * 1000 then state = "active" end elseif state == "active" then if bombs_disarmed < weapon_name[e] then TextCenterOnX(50,95,3,weapon_name[e]-bombs_disarmed.." bombs left") else PromptDuration("Proceed to the gate",5000) state = "done" gate_unlocked = 1 end end --state if GetInKey() == "" then pressed = 0 end end --main function phone_demand_exit(e) end