Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cooldownTable = {[13] = 1000, [4] = 2000, [2] = 400, [11] = 100}
- continuousFireTable = {[11] = true}
- myTimer = Timer()
- animTimer = Timer()
- hitMarkTimer = Timer()
- function Fire()
- myWeapon = LocalPlayer:GetEquippedWeapon()
- cooldownTime = cooldownTable[myWeapon.id]
- if cooldownTime == nil then
- print("nil value")
- cooldownTime = 1000
- end
- local results = LocalPlayer:GetAimTarget()
- if myTimer:GetMilliseconds() > cooldownTime then
- animTimer:Restart()
- myTimer:Restart()
- if results.entity then
- local entityType = results.entity.__type
- if entityType == "Vehicle" or entityType == "Player" then
- if myWeapon.ammo_clip > 0 and myWeapon.ammo_clip < 20 then
- hitMarkTimer:Restart()
- local args = {}
- args.weapon = myWeapon.id
- args.target = results.entity
- Network:Send("Shoot", args)
- end
- end
- end
- end
- end
- playFireAnimation = function(args)
- if animTimer:GetMilliseconds() < 100 and Game:GetState() == 4 then
- Input:SetValue(Action.FireRight, 1.0, false)
- end
- end
- blockdamage = function(args)
- return false
- end
- MouseDown = function(args)
- if args.button == 1 then
- if continuousFireTable[LocalPlayer:GetEquippedWeapon().id] == true then
- firing = true
- else
- Fire()
- end
- end
- end
- MouseUp = function(args)
- if args.button == 1 then
- if continuousFireTable[LocalPlayer:GetEquippedWeapon().id] == true then
- firing = false
- end
- end
- end
- function Tick()
- if hitMarkTimer:GetMilliseconds() < 100 then Render:DrawCircle(Render.Size/2, 10, Color(255, 0, 0)) end
- if firing == true then Fire() end
- end
- blacklist = {
- Action.FireGrapple,
- Action.ParachuteOpenClose,
- Action.FireRight
- }
- function blockFire(args)
- for index, action in ipairs(blacklist) do
- if action == args.input then
- return false
- end
- end
- end
- Events:Subscribe("LocalPlayerInput", blockFire)
- Events:Subscribe("LocalPlayerBulletHit", blockdamage)
- Events:Subscribe("MouseDown", MouseDown)
- Events:Subscribe("MouseUp", MouseUp)
- Events:Subscribe("Render", Tick)
- Events:Subscribe("InputPoll", playFireAnimation)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement