hostages_saved = 0 pressed = 0 gate_unlocked = 0 --change this to match how long in seconds the call conversation is local call_duration = 4 local in_range = 0 local state = "call" function geiseltrigger_init_name(e,name) weapon_name[e] = tonumber(name) end function geiseltrigger_main(e) Hide(e) CollisionOff(e) if state == "call" then if GetPlayerDistance(e) < 200 then PlaySoundIfSilent(e,0) in_range = 1 Prompt("Press E to answer the phone") if GetInKey() == "e" then StartTimer(e) PlaySound(e,1) state = "call2" end else if in_range == 1 then StartTimer(e) PlaySound(e,1) state = "call2" end end elseif state == "call2" then Prompt("Find and free the hostages!") if GetTimer(e) > call_duration * 3000 then state = "active" end elseif state == "active" then if hostages_saved < weapon_name[e] then TextCenterOnX(50,95,3,weapon_name[e]-hostages_saved.." hostage(s) left") else PromptDuration("Well done, all hostages are free!",5000) state = "done" gate_unlocked = 1 end end --state if GetInKey() == "" then pressed = 0 end end --main function geiseltrigger_exit(e) end