Advertisement
Baldeagle22

zxcfs

Sep 26th, 2018
424
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  2. local Player = owner
  3. local Mouse,mouse,UserInputService,ContextActionService
  4. do
  5. script.Parent = Player.Character
  6. local CAS = {Actions={}}
  7. local Event = Instance.new("RemoteEvent")
  8. Event.Name = "UserInput_Event"
  9. Event.Parent = Player.Character
  10. local fakeEvent = function()
  11. local t = {_fakeEvent=true}
  12. t.Connect = function(self,f)self.Function=f end
  13. t.connect = t.Connect
  14. return t
  15. end
  16. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  17. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  18. function CAS:BindAction(name,fun,touch,...)
  19. CAS.Actions[name] = {Name=name,Function=fun,Keys={...}}
  20. end
  21. function CAS:UnbindAction(name)
  22. CAS.Actions[name] = nil
  23. end
  24. local function te(self,ev,...)
  25. local t = m[ev]
  26. if t and t._fakeEvent and t.Function then
  27. t.Function(...)
  28. end
  29. end
  30. m.TrigEvent = te
  31. UIS.TrigEvent = te
  32. Event.OnServerEvent:Connect(function(plr,io)
  33. if plr~=Player then return end
  34. if io.isMouse then
  35. m.Target = io.Target
  36. m.Hit = io.Hit
  37. elseif io.UserInputType == Enum.UserInputType.MouseButton1 then
  38. if io.UserInputState == Enum.UserInputState.Begin then
  39. m:TrigEvent("Button1Down")
  40. else
  41. m:TrigEvent("Button1Up")
  42. end
  43. else
  44. for n,t in pairs(CAS.Actions) do
  45. for _,k in pairs(t.Keys) do
  46. if k==io.KeyCode then
  47. t.Function(t.Name,io.UserInputState,io)
  48. end
  49. end
  50. end
  51. if io.UserInputState == Enum.UserInputState.Begin then
  52. m:TrigEvent("KeyDown",io.KeyCode.Name:lower())
  53. UIS:TrigEvent("InputBegan",io,false)
  54. else
  55. m:TrigEvent("KeyUp",io.KeyCode.Name:lower())
  56. UIS:TrigEvent("InputEnded",io,false)
  57. end
  58. end
  59. end)
  60. --Gun Model
  61. ee=Instance.new("Tool",game.Players.baldeagle22.Backpack)
  62. ee.Name='Heavy Pistol'
  63. ee.RequiresHandle = true
  64. ee.TextureId = 'rbxassetid://381243171'
  65. ee.GripForward = Vector3.new(-0.013, -0.012, 1)
  66. ee.GripPos = Vector3.new(-0.198, 0.031, -0.808)
  67. ee.GripRight = Vector3.new(0.026, 1, 0.012)
  68. ee.GripUp = Vector3.new(1, -0.026, 0.013)
  69. rr=Instance.new("Part",ee)
  70. rr.Name='Handle'
  71. rr.Size = Vector3.new(0.9,0.9,2.1)
  72. rr.BackSurface = 'Smooth'
  73. rr.BottomSurface = 'Smooth'
  74. rr.FrontSurface = 'Smooth'
  75. rr.LeftSurface = 'Smooth'
  76. rr.RightSurface = 'Smooth'
  77. rr.TopSurface = 'Smooth'
  78. rr.BrickColor = BrickColor.new('Black')
  79. zz=Instance.new("SpecialMesh",rr)
  80. zz.MeshId = 'rbxassetid://450219827'
  81. zz.TextureId = 'rbxassetid://450219831'
  82. zz.Scale = Vector3.new(0.7,0.7,0.7)
  83. --Gun Light
  84. ff=Instance.new("PointLight",rr)
  85. ff.Enabled = false
  86. ff.Brightness = 5
  87. ff.Range = 10
  88. --Gun Script
  89. local function lol()
  90. mouse.Target:BreakJoints()
  91. mouse.Target.Anchored = false
  92. mouse.Target.Locked = false
  93. end
  94. local function sound()
  95. local ze=Instance.new("Sound",rr)
  96. ze.SoundId = 'rbxassetid://213603013'
  97. ze.Playing = true
  98. wait(4)
  99. ze:Destroy()
  100. end
  101. local function light()
  102. ff.Enabled = true
  103. wait(0.2)
  104. ff.Enabled = false
  105. end
  106. local function grip()
  107. ee.GripForward = Vector3.new(-0.249, -0.012, 0.968)
  108. ee.GripPos = Vector3.new(-0.338, 0.031, -0.876)
  109. ee.GripRight = Vector3.new(0.023, 1, 0.018)
  110. ee.GripUp = Vector3.new(0.968, -0.026, 0.249)
  111. wait(0.5)
  112. ee.GripForward = Vector3.new(-0.013, -0.012, 1)
  113. ee.GripPos = Vector3.new(-0.198, 0.031, -0.808)
  114. ee.GripRight = Vector3.new(0.026, 1, 0.012)
  115. ee.GripUp = Vector3.new(1, -0.026, 0.013)
  116. end
  117. ee.Activated:connect(grip)
  118. ee.Activated:connect(light)
  119. ee.Activated:connect(lol)
  120. ee.Activated:connect(sound)
  121.  
  122. --Made by 213455384113840128
  123. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement