Advertisement
Reversal00

sd

Dec 30th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.84 KB | None | 0 0
  1. --SynapseX Decompiler
  2.  
  3. wait()
  4. local Player = game.Players.LocalPlayer
  5. repeat
  6. wait()
  7. until Player.Character
  8. local Character = Player.Character
  9. repeat
  10. wait()
  11. until Player.Character.Humanoid
  12. local Humanoid = Player.Character.Humanoid
  13. local Tool = script.Parent
  14. local Mouse = Player:GetMouse()
  15. local Camera = workspace.CurrentCamera
  16. local UserInputService = game:GetService("UserInputService")
  17. local reticleOn = game.ReplicatedStorage.ReticleOn.Value
  18. game.ReplicatedStorage.ReticleOn.Changed:connect(function()
  19. reticleOn = game.ReplicatedStorage.ReticleOn.Value
  20. end)
  21. local plrId = Player.userId
  22. local canThrow = true
  23. local dualWeilding = false
  24. local killpassword = 123
  25. game.ReplicatedStorage.Remotes.Authenticator.OnClientEvent:connect(function(pw)
  26. killpassword = pw
  27. end)
  28. game.ReplicatedStorage.Remotes.Authenticator:FireServer()
  29. Mouse.TargetFilter = Camera
  30. local ToolEquipped = false
  31. local AnimationBusy = false
  32. local ANIM_SPEED = 1.5
  33. local THROW_LENGTH = 0.35
  34. local THROW_DELAY = 0.35
  35. local ANIMATIONS = {
  36. DownStab = Humanoid:LoadAnimation(Tool.DownStab),
  37. StabPunch = Humanoid:LoadAnimation(Tool.StabPunch),
  38. ThrowCharge = Humanoid:LoadAnimation(Tool.ThrowCharge),
  39. Throw = Humanoid:LoadAnimation(Tool.Throw),
  40. DualEquip = Humanoid:LoadAnimation(Tool.DualEquip)
  41. }
  42. local throwing = false
  43. local DamageEnabled = true
  44. local canKill = false
  45. script.Parent.Handle.Touched:connect(function(h)
  46. if AnimationBusy and canKill and DamageEnabled and h.Parent ~= Character and h.Parent:FindFirstChild("Humanoid") and Tool.Handle.KnifeDecorationHandle.Transparency < 1 then
  47. DamageEnabled = false
  48. coroutine.wrap(function()
  49. Player.PlayerScripts.localknifehandler.HitCheck:Fire(h.Parent)
  50. end)()
  51. wait(0.7)
  52. DamageEnabled = true
  53. end
  54. end)
  55. local function stab()
  56. if not AnimationBusy and Tool.Parent == Player.Character and Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 then
  57. AnimationBusy = true
  58. local startTime2 = tick()
  59. Tool.Handle.Swoosh.Pitch = math.random(1100, 1300) / 1000
  60. Tool.Handle.Swoosh:Play()
  61. canKill = true
  62. coroutine.wrap(function()
  63. wait(0.3)
  64. canKill = false
  65. end)()
  66. if math.random(3) == 1 then
  67. do
  68. local initGrip = Tool.Grip
  69. coroutine.wrap(function()
  70. Tool.Grip = initGrip * CFrame.Angles(math.pi, 0, 0)
  71. wait(0.6)
  72. Tool.Grip = initGrip
  73. end)()
  74. ANIMATIONS.DownStab:Play(0.1, 1, ANIM_SPEED)
  75. end
  76. else
  77. ANIMATIONS.StabPunch:Play(0.1, 1, ANIM_SPEED)
  78. end
  79. repeat
  80. wait()
  81. until startTime2 + 0.68 <= tick()
  82. AnimationBusy = false
  83. end
  84. end
  85. local canUpdate = true
  86. dualWeilding = game.ReplicatedStorage.Remotes.IsDual:InvokeServer()
  87. if dualWeilding then
  88. end
  89. local effectTransparency = Tool.Handle.KnifeDecorationHandle.Transparency
  90. local wielded = false
  91. Tool.Equipped:connect(function()
  92. if dualWeilding then
  93. ANIMATIONS.DualEquip:Play()
  94. end
  95. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  96. ToolEquipped = true
  97. Tool.Handle.Swoosh:Stop()
  98. spawn(function()
  99. if dualWeilding and not wielded then
  100. wielded = true
  101. repeat
  102. wait()
  103. until Character:FindFirstChild("Knife")
  104. game.ReplicatedStorage.Remotes.ApplyDual:FireServer(Tool.Handle)
  105. end
  106. end)
  107. Tool.Handle.KnifeDecorationHandle.Transparency = effectTransparency
  108. game.ReplicatedStorage.Remotes.SheathKnife:FireServer("off")
  109. end)
  110. Tool.Unequipped:connect(function()
  111. canUpdate = true
  112. pcall(function()
  113. Mouse.Icon = ""
  114. ToolEquipped = false
  115. if Character:FindFirstChild("DecKnife") then
  116. end
  117. game.ReplicatedStorage.Remotes.SheathKnife:FireServer("on")
  118. end)
  119. ANIMATIONS.DualEquip:Stop()
  120. end)
  121. local validMouseHit
  122. local middleX = Camera.ViewportSize.X * 0.5
  123. local middleY = Camera.ViewportSize.Y * 0.4
  124. local mouseDown = false
  125. if not UserInputService.TouchEnabled then
  126. UserInputService.InputBegan:connect(function(input, gameProcessed)
  127. if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.KeyCode == Enum.KeyCode.ButtonR2) and not gameProcessed then
  128. mouseDown = true
  129. if ToolEquipped then
  130. mouseDown = true
  131. local startTime = tick()
  132. if not AnimationBusy and Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 then
  133. ANIMATIONS.ThrowCharge:Play(0.1, 1, 2)
  134. repeat
  135. wait()
  136. until startTime + THROW_LENGTH <= tick() or not mouseDown
  137. ANIMATIONS.ThrowCharge:Stop()
  138. if not mouseDown and Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 then
  139. stab()
  140. elseif Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 and startTime + THROW_DELAY <= tick() and canThrow then
  141. canThrow = false
  142. local ray = Camera:ViewportPointToRay(Mouse.X, Mouse.Y, 1000)
  143. local char, mapIgnore
  144. local knifeHost = workspace.KnifeHost
  145. local ragdollHost = workspace.Ragdolls
  146. local petHost = workspace.Pets
  147. if Player.Character then
  148. char = Player.Character
  149. end
  150. if game.Workspace:FindFirstChild("GameMap") and game.Workspace.GameMap:FindFirstChild("IGNORE") then
  151. mapIgnore = game.Workspace.GameMap.IGNORE
  152. else
  153. mapIgnore = workspace.KnifeHost
  154. end
  155. game.ReplicatedStorage.Remotes.ThrowKnife:FireServer(Humanoid.TargetPoint, effectTransparency, Tool.RotateValue.Value)
  156. Tool.Handle.Swoosh.Pitch = math.random(1100, 1300) / 1000
  157. Tool.Handle.Swoosh:Play()
  158. ANIMATIONS.Throw:Play(0.1, 1, 3)
  159. throwing = true
  160. coroutine.wrap(function()
  161. wait(1.2)
  162. canThrow = true
  163. end)()
  164. wait(1)
  165. throwing = false
  166. Tool.Handle.KnifeDecorationHandle.Transparency = effectTransparency
  167. end
  168. end
  169. end
  170. end
  171. end)
  172. UserInputService.InputEnded:connect(function(input, gameProcessed)
  173. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.KeyCode == Enum.KeyCode.ButtonR2 then
  174. mouseDown = false
  175. end
  176. end)
  177. else
  178. UserInputService.InputBegan:connect(function(input, gameProcessed)
  179. if input.UserInputType == Enum.UserInputType.Touch and not gameProcessed then
  180. mouseDown = true
  181. wait(0.05)
  182. if input.Delta.Magnitude < 1 and mouseDown and ToolEquipped then
  183. mouseDown = true
  184. local startTime = tick()
  185. if not AnimationBusy and Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 then
  186. ANIMATIONS.ThrowCharge:Play(0.1, 1, 2)
  187. repeat
  188. wait()
  189. until startTime + THROW_LENGTH <= tick() or not mouseDown
  190. ANIMATIONS.ThrowCharge:Stop()
  191. if not mouseDown and Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 then
  192. stab()
  193. elseif Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 and startTime + THROW_DELAY <= tick() and canThrow then
  194. canThrow = false
  195. if reticleOn then
  196. local RayMag1 = Camera:ViewportPointToRay(middleX, middleY)
  197. local NewRay = Ray.new(RayMag1.Origin, RayMag1.Direction * 1000)
  198. local Target, hit = workspace:FindPartOnRay(NewRay, Player.Character)
  199. game.ReplicatedStorage.Remotes.ThrowKnife:FireServer(hit, effectTransparency, Tool.RotateValue.Value)
  200. else
  201. local ray = Camera:ViewportPointToRay(input.Position.x, input.Position.y, 1000)
  202. local ignore = game.Workspace.KnifeHost
  203. if game.Workspace:FindFirstChild("Map") then
  204. ignore = game.Workspace.Map:FindFirstChild("IGNORE")
  205. end
  206. local part, hit = game.Workspace:FindPartOnRayWithIgnoreList(ray, {
  207. Player.Character
  208. })
  209. game.ReplicatedStorage.Remotes.ThrowKnife:FireServer(hit, effectTransparency, Tool.RotateValue.Value)
  210. end
  211. Tool.Handle.Swoosh.Pitch = math.random(1100, 1300) / 1000
  212. Tool.Handle.Swoosh:Play()
  213. ANIMATIONS.Throw:Play(0.1, 1, 3)
  214. throwing = true
  215. coroutine.wrap(function()
  216. wait(1.2)
  217. canThrow = true
  218. end)()
  219. wait(1)
  220. Tool.Handle.KnifeDecorationHandle.Transparency = effectTransparency
  221. throwing = false
  222. end
  223. end
  224. end
  225. end
  226. end)
  227. UserInputService.InputBegan:connect(function(input, gameProcessed)
  228. if input.UserInputType == Enum.UserInputType.MouseButton1 and not gameProcessed then
  229. print("mouse hit on touch enabled")
  230. mouseDown = true
  231. if ToolEquipped then
  232. mouseDown = true
  233. local startTime = tick()
  234. if not AnimationBusy and Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 then
  235. ANIMATIONS.ThrowCharge:Play(0.1, 1, 2)
  236. repeat
  237. wait()
  238. until startTime + THROW_LENGTH <= tick() or not mouseDown
  239. ANIMATIONS.ThrowCharge:Stop()
  240. if not mouseDown and Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 then
  241. stab()
  242. elseif Tool.Handle.KnifeDecorationHandle.Transparency < 0.6 and startTime + THROW_DELAY <= tick() and canThrow then
  243. canThrow = false
  244. local ray = Camera:ViewportPointToRay(Mouse.X, Mouse.Y, 1000)
  245. local char, mapIgnore
  246. local knifeHost = workspace.KnifeHost
  247. local ragdollHost = workspace.Ragdolls
  248. local petHost = workspace.Pets
  249. if Player.Character then
  250. char = Player.Character
  251. end
  252. if game.Workspace:FindFirstChild("GameMap") and game.Workspace.GameMap:FindFirstChild("IGNORE") then
  253. mapIgnore = game.Workspace.GameMap.IGNORE
  254. else
  255. mapIgnore = workspace.KnifeHost
  256. end
  257. game.ReplicatedStorage.Remotes.ThrowKnife:FireServer(Humanoid.TargetPoint, effectTransparency, Tool.RotateValue.Value)
  258. Tool.Handle.Swoosh.Pitch = math.random(1100, 1300) / 1000
  259. Tool.Handle.Swoosh:Play()
  260. ANIMATIONS.Throw:Play(0.1, 1, 3)
  261. throwing = true
  262. coroutine.wrap(function()
  263. wait(1.2)
  264. canThrow = true
  265. end)()
  266. wait(1)
  267. throwing = false
  268. Tool.Handle.KnifeDecorationHandle.Transparency = effectTransparency
  269. end
  270. end
  271. end
  272. end
  273. end)
  274. UserInputService.InputEnded:connect(function(input, gameProcessed)
  275. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  276. mouseDown = false
  277. end
  278. end)
  279. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement