Advertisement
LordNoobIV

Untitled

Apr 3rd, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     cooldownTable = {[13] = 1000, [4] = 2000, [2] = 400}
  2.  
  3.     cooldownTime = cooldownTable[myWeapon.id]
  4.  
  5.     if table.find(myWeapon.id, cooldownTable) == nil then
  6.             cooldownTime = 1000
  7.     end
  8.  
  9.     myTimer = Timer()
  10.        
  11.     function Foo(args)
  12.             if args.input == Action.FireRight then
  13.                     local results = LocalPlayer:GetAimTarget()
  14.                     if results.entity and myTimer:GetMilliseconds() > cooldownTime then
  15.                             local entityType = results.entity.__type
  16.                 if entityType == "Vehicle" or entityType == "Player" then
  17.                                 Chat:Print("You are aiming at a "..entityType..": "..tostring(results.entity), Color(255, 255, 255))
  18.                             local args = {}
  19.                                 args.player = LocalPlayer
  20.                                 args.target = results.entity
  21.                                 Network:Send("Shoot", args)
  22.                     myTimer:Restart()
  23.                             end
  24.                     end
  25.             end
  26.     end
  27.      
  28.     Events:Subscribe("LocalPlayerInput", Foo)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement