Dark_EccentricYT

Untitled

Sep 2nd, 2017
2,858
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.86 KB | None | 0 0
  1. --Made by N3xul
  2. local runDummyScript = function(f,scri)
  3. local oldenv = getfenv(f)
  4. local newenv = setmetatable({}, {
  5. __index = function(_, k)
  6. if k:lower() == 'script' then
  7. return scri
  8. else
  9. return oldenv[k]
  10. end
  11. end
  12. })
  13. setfenv(f, newenv)
  14. ypcall(function() f() end)
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. mas.Name = "CompiledModel"
  19. o1 = Instance.new("Tool")
  20. o2 = Instance.new("LocalScript")
  21. o3 = Instance.new("Script")
  22. o4 = Instance.new("Part")
  23. o5 = Instance.new("CylinderMesh")
  24. o6 = Instance.new("Weld")
  25. o7 = Instance.new("Sound")
  26. o8 = Instance.new("Sound")
  27. o9 = Instance.new("Sound")
  28. o10 = Instance.new("Sound")
  29. o11 = Instance.new("Sound")
  30. o13 = Instance.new("Part")
  31. o14 = Instance.new("CylinderMesh")
  32. o15 = Instance.new("Weld")
  33. o16 = Instance.new("Script")
  34. o17 = Instance.new("Part")
  35. o18 = Instance.new("CylinderMesh")
  36. o19 = Instance.new("Weld")
  37. o20 = Instance.new("Script")
  38. o21 = Instance.new("Part")
  39. o22 = Instance.new("CylinderMesh")
  40. o23 = Instance.new("Script")
  41. o24 = Instance.new("BoolValue")
  42. o25 = Instance.new("BoolValue")
  43. o26 = Instance.new("BoolValue")
  44. o27 = Instance.new("Script")
  45. o28 = Instance.new("LocalScript")
  46. o29 = Instance.new("Animation")
  47. o30 = Instance.new("Animation")
  48. o31 = Instance.new("Animation")
  49. o32 = Instance.new("Animation")
  50. o33 = Instance.new("Animation")
  51. o34 = Instance.new("Animation")
  52. o1.Name = "Police Baton"
  53. o1.Parent = mas
  54. o2.Name = "Local Gui"
  55. o2.Parent = o1
  56. table.insert(cors,coroutine.create(function()
  57. wait()
  58. runDummyScript(function()
  59. local Tool = script.Parent;
  60.  
  61. enabled = true
  62. function onButton1Down(mouse)
  63. if not enabled then
  64. return
  65. end
  66.  
  67. enabled = false
  68. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  69.  
  70. wait(1)
  71. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  72. enabled = true
  73.  
  74. end
  75.  
  76. function onEquippedLocal(mouse)
  77.  
  78. if mouse == nil then
  79. print("Mouse not found")
  80. return
  81. end
  82.  
  83. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  84. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  85. end
  86.  
  87.  
  88. Tool.Equipped:connect(onEquippedLocal)
  89.  
  90. end,o2)
  91. end))
  92. o3.Name = "Weld"
  93. o3.Parent = o1
  94. table.insert(cors,coroutine.create(function()
  95. wait()
  96. runDummyScript(function()
  97. local prev
  98. local parts = script.Parent:GetChildren()
  99. for i = 1,#parts do
  100. --remove any of the following parts that say "(parts[i].className == [className])" if you want to exclude that particular className type from the Weld
  101. if ((parts[i].className == "Part") or (parts[i].className == "SpawnLocation") or (parts[i].className == "Seat") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat")) then
  102. if (prev ~= nil) then
  103. local weld = Instance.new("Weld")
  104. weld.Part0 = prev
  105. weld.Part1 = parts[i]
  106. weld.C0 = prev.CFrame:inverse()
  107. weld.C1 = parts[i].CFrame:inverse()
  108. weld.Parent = prev
  109. parts[i].Anchored = false
  110. end
  111. prev = parts[i]
  112. end
  113. end
  114. wait(3)
  115.  
  116. end,o3)
  117. end))
  118. o4.Name = "Handle"
  119. o4.Parent = o1
  120. o4.Material = Enum.Material.Fabric
  121. o4.BrickColor = BrickColor.new("Black")
  122. o4.Position = Vector3.new(-99.2203217, 4.54420996, -80.643074)
  123. o4.Rotation = Vector3.new(104.999954, 90, 0)
  124. o4.FormFactor = Enum.FormFactor.Custom
  125. o4.Size = Vector3.new(0.300000012, 1, 0.300000012)
  126. o4.CFrame = CFrame.new(-99.2203217, 4.54420996, -80.643074, 3.0172731e-010, -7.34871719e-010, 1, 0.965919137, -0.258816421, -8.5492502e-011, 0.258816421, 0.965919137, 1.23691279e-010)
  127. o4.BottomSurface = Enum.SurfaceType.Weld
  128. o4.TopSurface = Enum.SurfaceType.Smooth
  129. o4.Color = Color3.new(0.105882, 0.164706, 0.207843)
  130. o4.Position = Vector3.new(-99.2203217, 4.54420996, -80.643074)
  131. o5.Parent = o4
  132. o5.Scale = Vector3.new(0.899999976, 1, 0.899999976)
  133. o6.Parent = o4
  134. o6.C0 = CFrame.new(-457.99826, -25.7006931, 446.902222, -1, 3.05171125e-005, 3.05180438e-005, 3.05180438e-005, 1, 3.05171125e-005, -3.05171125e-005, 3.05180438e-005, -1)
  135. o6.C1 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-005, 3.05180438e-005, 3.05180438e-005, -1, 3.05171125e-005, 3.05171125e-005, 3.05180438e-005, 1)
  136. o6.Part0 = o4
  137. o6.Part1 = o13
  138. o7.Name = "HitSound"
  139. o7.Parent = o4
  140. o7.SoundId = "rbxassetid://169259022"
  141. o7.Volume = 1
  142. o8.Name = "LungeSound"
  143. o8.Parent = o4
  144. o8.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
  145. o8.Volume = 1
  146. o9.Name = "OverheadSound"
  147. o9.Parent = o4
  148. o9.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
  149. o9.Volume = 1
  150. o10.Name = "UnsheathSound"
  151. o10.Parent = o4
  152. o10.SoundId = "rbxassetid://240784215"
  153. o10.Volume = 1
  154. o11.Name = "SlashSound"
  155. o11.Parent = o4
  156. o11.SoundId = "http://www.roblox.com/Asset/?ID= 101164100"
  157. o11.Volume = 1
  158. o13.Parent = o1
  159. o13.BrickColor = BrickColor.new("Really black")
  160. o13.Reflectance = 0.20000000298023
  161. o13.Position = Vector3.new(-99.2290115, 4.01587152, -78.7071228)
  162. o13.Rotation = Vector3.new(-75.0035477, -90, 0)
  163. o13.FormFactor = Enum.FormFactor.Custom
  164. o13.Size = Vector3.new(0.300000012, 1, 0.300000012)
  165. o13.CFrame = CFrame.new(-99.2290115, 4.01587152, -78.7071228, -1.64371372e-009, -6.10355492e-005, -1, 0.965939522, 0.258758694, -1.57951999e-005, 0.258758694, -0.965939522, 5.8956397e-005)
  166. o13.BottomSurface = Enum.SurfaceType.Weld
  167. o13.TopSurface = Enum.SurfaceType.Weld
  168. o13.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  169. o13.Position = Vector3.new(-99.2290115, 4.01587152, -78.7071228)
  170. o14.Parent = o13
  171. o14.Scale = Vector3.new(0.300000012, 1, 0.300000012)
  172. o15.Parent = o13
  173. o15.C0 = CFrame.new(-457.987274, 27.7081051, -446.912628, -1, -3.05171125e-005, 3.05180438e-005, 3.05180438e-005, -1, 3.05171125e-005, 3.05171125e-005, 3.05180438e-005, 1)
  174. o15.C1 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-005, 3.05180438e-005, 3.05180438e-005, -1, 3.05171125e-005, 3.05171125e-005, 3.05180438e-005, 1)
  175. o15.Part0 = o13
  176. o15.Part1 = o17
  177. o16.Parent = o13
  178. table.insert(cors,coroutine.create(function()
  179. wait()
  180. runDummyScript(function()
  181. function onTouched(hit)
  182. h = hit.Parent:findFirstChild("Humanoid")
  183. if h ~= nil then
  184. h.Sit = true
  185. h.Health = h.Health - 0
  186. end
  187. end
  188. script.Parent.Touched:connect(onTouched)
  189.  
  190. end,o16)
  191. end))
  192. o17.Parent = o1
  193. o17.BrickColor = BrickColor.new("Really black")
  194. o17.Reflectance = 0.20000000298023
  195. o17.Position = Vector3.new(-99.222908, 4.28349018, -79.6806641)
  196. o17.Rotation = Vector3.new(-75.0035477, -90, 0)
  197. o17.FormFactor = Enum.FormFactor.Custom
  198. o17.Size = Vector3.new(0.300000012, 1, 0.300000012)
  199. o17.CFrame = CFrame.new(-99.222908, 4.28349018, -79.6806641, -1.64371372e-009, -6.10355492e-005, -1, 0.965939522, 0.258758694, -1.57951999e-005, 0.258758694, -0.965939522, 5.8956397e-005)
  200. o17.BottomSurface = Enum.SurfaceType.Weld
  201. o17.TopSurface = Enum.SurfaceType.Weld
  202. o17.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  203. o17.Position = Vector3.new(-99.222908, 4.28349018, -79.6806641)
  204. o18.Parent = o17
  205. o18.Scale = Vector3.new(0.5, 1, 0.5)
  206. o19.Parent = o17
  207. o19.C0 = CFrame.new(-457.993866, 26.698473, -446.906464, -1, -3.05171125e-005, 3.05180438e-005, 3.05180438e-005, -1, 3.05171125e-005, 3.05171125e-005, 3.05180438e-005, 1)
  208. o19.C1 = CFrame.new(-457.993408, 28.2644634, -446.909058, -1, -3.05161811e-005, 3.05189751e-005, 3.05189751e-005, -1, 9.15522687e-005, 3.05161811e-005, 9.15532e-005, 1)
  209. o19.Part0 = o17
  210. o19.Part1 = o21
  211. o20.Parent = o17
  212. table.insert(cors,coroutine.create(function()
  213. wait()
  214. runDummyScript(function()
  215. function onTouched(hit)
  216. h = hit.Parent:findFirstChild("Humanoid")
  217. if h ~= nil then
  218. h.Sit = true
  219. h.Health = h.Health - 0
  220. end
  221. end
  222. script.Parent.Touched:connect(onTouched)
  223.  
  224. end,o20)
  225. end))
  226. o21.Parent = o1
  227. o21.BrickColor = BrickColor.new("Really black")
  228. o21.Reflectance = 0.20000000298023
  229. o21.Position = Vector3.new(-99.2236633, 3.87077618, -78.1417847)
  230. o21.Rotation = Vector3.new(-75.0035477, -90, 0)
  231. o21.FormFactor = Enum.FormFactor.Custom
  232. o21.Size = Vector3.new(0.300000012, 0.200000003, 0.300000012)
  233. o21.CFrame = CFrame.new(-99.2236633, 3.87077618, -78.1417847, -2.57497934e-009, -0.000122070705, -1, 0.965939522, 0.258758694, -3.15894795e-005, 0.258758694, -0.965939522, 0.000117912423)
  234. o21.BottomSurface = Enum.SurfaceType.Smooth
  235. o21.TopSurface = Enum.SurfaceType.Weld
  236. o21.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  237. o21.Position = Vector3.new(-99.2236633, 3.87077618, -78.1417847)
  238. o22.Parent = o21
  239. o22.Offset = Vector3.new(0, 0.150000006, 0)
  240. o22.Scale = Vector3.new(0.5, 0.5, 0.5)
  241. o23.Parent = o21
  242. table.insert(cors,coroutine.create(function()
  243. wait()
  244. runDummyScript(function()
  245. function onTouched(hit)
  246. h = hit.Parent:findFirstChild("Humanoid")
  247. if h ~= nil then
  248. h.Sit = true
  249. h.Health = h.Health - 0
  250. end
  251. end
  252. script.Parent.Touched:connect(onTouched)
  253.  
  254. end,o23)
  255. end))
  256. o24.Name = "PlayOverhead"
  257. o24.Parent = o1
  258. o25.Name = "PlaySlash"
  259. o25.Parent = o1
  260. o26.Name = "PlayThrust"
  261. o26.Parent = o1
  262. o27.Name = "SwordScript"
  263. o27.Parent = o1
  264. table.insert(cors,coroutine.create(function()
  265. wait()
  266. runDummyScript(function()
  267. r = game:service("RunService")
  268.  
  269. local damage = 0
  270.  
  271. sword = script.Parent.Handle
  272. Tool = script.Parent
  273.  
  274. local damages,values,sounds = {30,45,65},{Tool.PlaySlash,Tool.PlayThrust,Tool.PlayOverhead},{Tool.Handle.SlashSound,Tool.Handle.OverheadSound,Tool.Handle.LungeSound}
  275. local enabledToDamage = true
  276.  
  277. function blow(hit)
  278. if enabledToDamage == false then return end
  279. enabledToDamage = false
  280. if (hit.Parent == nil) then enabledToDamage = true return end -- happens when bullet hits sword
  281. local humanoid = hit.Parent:findFirstChild("Humanoid")
  282. local vCharacter = Tool.Parent
  283. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  284. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  285. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  286. -- final check, make sure sword is in-hand
  287. local right_arm = vCharacter:FindFirstChild("Right Arm")
  288. if (right_arm ~= nil) then
  289. local joint = right_arm:FindFirstChild("RightGrip")
  290. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  291. tagHumanoid(humanoid, vPlayer)
  292. humanoid:TakeDamage(damage)
  293. wait(1)
  294. untagHumanoid(humanoid)
  295. else
  296. enabledToDamage = true
  297. end
  298. else
  299. enabledToDamage = true
  300. end
  301. else
  302. enabledToDamage = true
  303. end
  304. end
  305.  
  306.  
  307. function tagHumanoid(humanoid, player)
  308. local creator_tag = Instance.new("ObjectValue")
  309. creator_tag.Value = player
  310. creator_tag.Name = "creator"
  311. creator_tag.Parent = humanoid
  312. end
  313.  
  314. function untagHumanoid(humanoid)
  315. if humanoid ~= nil then
  316. local tag = humanoid:findFirstChild("creator")
  317. if tag ~= nil then
  318. tag.Parent = nil
  319. end
  320. end
  321. end
  322.  
  323.  
  324. function attack()
  325. damage = slash_damage
  326. script.Parent.Handle.SlashSound:Play()
  327. script.Parent.PlaySlash.Value = not script.Parent.PlaySlash.Value
  328. end
  329.  
  330. function lunge()
  331. damage = lunge_damage
  332. script.Parent.Handle.LungeSound:Play()
  333. script.Parent.PlayOverhead.Value = not script.Parent.PlayOverhead.Value
  334. force = Instance.new("BodyVelocity")
  335. force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
  336. force.Parent = Tool.Parent.Torso
  337. wait(.5)
  338. force.Parent = nil
  339. wait(.5)
  340. damage = slash_damage
  341. end
  342.  
  343.  
  344. Tool.Enabled = true
  345. local last_attack = 0
  346. local status = 0
  347.  
  348. function onActivated()
  349. if not Tool.Enabled then
  350. return
  351. end
  352. Tool.Enabled = false
  353. local character = Tool.Parent;
  354. local humanoid = character.Humanoid
  355. if humanoid == nil then
  356. print("Humanoid not found")
  357. return
  358. end
  359. t = r.Stepped:wait()
  360. if (t - last_attack < 1.5) then
  361. if status == 3 then
  362. status = 0
  363. damage = 0
  364. else
  365. status = status + 1
  366. values[status].Value = not values[status].Value
  367. damage = damages[status]
  368. sounds[status]:Play()
  369. enabledToDamage = true
  370. wait(0.5)
  371. enabledToDamage = false
  372. end
  373. else
  374. status = 0
  375. damage = 0
  376. end
  377. last_attack = t
  378. Tool.Enabled = true
  379. end
  380.  
  381. function onEquipped()
  382. wait(1/3)
  383. Tool.Handle.UnsheathSound:Play()
  384. end
  385.  
  386. Tool.Equipped:connect(onEquipped)
  387. script.Parent.Activated:connect(onActivated)
  388. connection = sword.Touched:connect(blow)
  389. end,o27)
  390. end))
  391. o28.Name = "AnimationScript"
  392. o28.Parent = o1
  393. table.insert(cors,coroutine.create(function()
  394. wait()
  395. runDummyScript(function()
  396. -- Waits for the child of the specified parent
  397. local function WaitForChild(parent, childName)
  398. while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
  399. return parent[childName]
  400. end
  401.  
  402. local Tool = script.Parent
  403.  
  404. local Animations = {}
  405. local MyHumanoid
  406. local MyCharacter
  407.  
  408.  
  409. local function PlayAnimation(animationName)
  410. if Animations[animationName] then
  411. Animations[animationName]:Play()
  412. end
  413. end
  414.  
  415. local function StopAnimation(animationName)
  416. if Animations[animationName] then
  417. Animations[animationName]:Stop()
  418. end
  419. end
  420.  
  421.  
  422. function OnEquipped(mouse)
  423. MyCharacter = Tool.Parent
  424. MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
  425. if MyHumanoid then
  426. Animations['EquipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'EquipAnim5'))
  427. Animations['IdleAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
  428. Animations['OverheadAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'OverheadAnim2'))
  429. Animations['SlashAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'SlashAnim2'))
  430. Animations['ThrustAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'ThrustAnim2'))
  431. Animations['UnequipAnim'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'UnequipAnim2'))
  432. end
  433. PlayAnimation('EquipAnim')
  434. PlayAnimation('IdleAnim')
  435. end
  436.  
  437. function OnUnequipped()
  438. for animName, _ in pairs(Animations) do
  439. StopAnimation(animName)
  440. end
  441. end
  442.  
  443. Tool.Equipped:connect(OnEquipped)
  444. Tool.Unequipped:connect(OnUnequipped)
  445.  
  446. WaitForChild(Tool, 'PlaySlash').Changed:connect(
  447. function (value)
  448. --if value then
  449. PlayAnimation('SlashAnim')
  450. --else
  451. -- StopAnimation('SlashAnim')
  452. --end
  453. end)
  454.  
  455. WaitForChild(Tool, 'PlayThrust').Changed:connect(
  456. function (value)
  457. --if value then
  458. PlayAnimation('ThrustAnim')
  459. --else
  460. -- StopAnimation('ThrustAnim')
  461. --end
  462. end)
  463.  
  464. WaitForChild(Tool, 'PlayOverhead').Changed:connect(
  465. function (value)
  466. --if value then
  467. PlayAnimation('OverheadAnim')
  468. --else
  469. -- StopAnimation('OverheadAnim')
  470. --end
  471. end)
  472.  
  473. end,o28)
  474. end))
  475. o29.Name = "IdleAnim3"
  476. o29.Parent = o1
  477. o29.AnimationId = "http://www.roblox.com/Asset?ID=94108418"
  478. o30.Name = "OverheadAnim2"
  479. o30.Parent = o1
  480. o30.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
  481. o31.Name = "UnequipAnim2"
  482. o31.Parent = o1
  483. o31.AnimationId = "http://www.roblox.com/Asset?ID=94095929"
  484. o32.Name = "EquipAnim5"
  485. o32.Parent = o1
  486. o32.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  487. o33.Name = "ThrustAnim2"
  488. o33.Parent = o1
  489. o33.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
  490. o34.Name = "SlashAnim2"
  491. o34.Parent = o1
  492. o34.AnimationId = "http://www.roblox.com/Asset?ID=94160738"
  493. mas.Parent = workspace
  494. mas:MakeJoints()
  495. local mas1 = mas:GetChildren()
  496. for i=1,#mas1 do
  497. mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack
  498. ypcall(function() mas1[i]:MakeJoints() end)
  499. end
  500. mas:Destroy()
  501. for i=1,#cors do
  502. coroutine.resume(cors[i])
  503. end
Add Comment
Please, Sign In to add comment