Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- moveTimer = Timer()
- PulseTimer = Timer()
- eTable = {}
- on = false
- cPlayer = LocalPlayer
- function fireEffect(eid)
- effect1 = ClientEffect.Create(AssetLocation.Game, {
- effect_id = eid,
- position = cPlayer:GetPosition(),
- angle = Angle()
- })
- print(eid)
- print(effect1)
- print(effect1:GetEffectId())
- end
- EMP = function(args)
- if args.key == string.byte("M") then
- print("lol")
- Game:FireEvent("gui.mercenarymode.show")
- elseif args.key == string.byte("Z") and on == false then
- print(on)
- if effect1 ~= ClientEffect or effect1 == nil then
- fireEffect(287)
- end
- if PulseTimer:GetSeconds() > 1 then
- Network:Send("Activated", args)
- print("Valid time. Sending to network.")
- print(tostring(LocalPlayer), "activated EMP. Sending to network.")
- end
- elseif args.key == string.byte("X") and effect1:IsValid() == true then
- effect1:Remove()
- Network:Send("Deactictivated", args)
- end
- end
- Pulse = function(args)
- if PulseTimer:GetSeconds() > 3 then
- fireEffect(137)
- PulseTimer:Restart()
- end
- end
- EMPHit = function(args)
- Chat:Print("You were hit by an EMP!", Color(255, 0, 0))
- end
- MoveTo = function(args)
- PlayerPosition = LocalPlayer:GetPosition()
- PlayerAngle = LocalPlayer:GetAngle()
- Position = PlayerPosition + (PlayerAngle * Vector3(0, 0, 0))
- if effect1 then
- effect1:SetPosition(Position)
- end
- end
- Cleanup = function(args)
- if effect1 ~= nil then
- effect1:Remove()
- print("Removing stray effects")
- end
- end
- Events:Subscribe("ModulesLoad", Cleanup)
- Events:Subscribe("KeyDown", EMP)
- Events:Subscribe("PreTick", MoveTo)
- Network:Subscribe("Found", Pulse)
- Network:Subscribe("Hit", EMPHit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement