Advertisement
Animescapetower

delete hammer

May 24th, 2018
820
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.74 KB | None | 0 0
  1. --Converted with ttyyuu12345's model to script plugin v4
  2. function sandbox(var,func)
  3. local env = getfenv(func)
  4. local newenv = setmetatable({},{
  5. __index = function(self,k)
  6. if k=="script" then
  7. return var
  8. else
  9. return env[k]
  10. end
  11. end,
  12. })
  13. setfenv(func,newenv)
  14. return func
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. Script0 = Instance.new("Script")
  19. Script1 = Instance.new("Script")
  20. LocalScript2 = Instance.new("LocalScript")
  21. Part3 = Instance.new("Part")
  22. SpecialMesh4 = Instance.new("SpecialMesh")
  23. Sound5 = Instance.new("Sound")
  24. Tool6 = Instance.new("Tool")
  25. Part7 = Instance.new("Part")
  26. SpecialMesh8 = Instance.new("SpecialMesh")
  27. Sound9 = Instance.new("Sound")
  28. Script10 = Instance.new("Script")
  29. Script11 = Instance.new("Script")
  30. LocalScript12 = Instance.new("LocalScript")
  31. Script10.Name = "Destroy"
  32. Script10.Parent = Tool6
  33. table.insert(cors,sandbox(Script10,function()
  34.  
  35.  
  36. local Tool = script.Parent --make sure this is a Tool object
  37.  
  38. Tool.Equipped:connect(function(Mouse)
  39. Mouse.Button1Down:connect(function()
  40. script.Parent.Handle.Touched:connect(function(hit)
  41. hit.Transparency = 0
  42. for n = 1,40 do
  43. wait()
  44. hit.BrickColor = BrickColor.Random()
  45. end
  46.  
  47. wait()
  48. hit:Destroy()
  49. end)
  50. end)
  51. end)
  52.  
  53.  
  54.  
  55.  
  56.  
  57. end))
  58. Script11.Name = "Sword Script"
  59. Script11.Parent = Tool6
  60. table.insert(cors,sandbox(Script11,function()
  61. -------- OMG HAX
  62.  
  63. r = game:service("RunService")
  64.  
  65.  
  66. local damage = 10
  67.  
  68.  
  69. local slash_damage = 10
  70.  
  71. sword = script.Parent.Handle
  72. Tool = script.Parent
  73.  
  74.  
  75. local SlashSound = Instance.new("Sound")
  76. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  77. SlashSound.Parent = sword
  78. SlashSound.Volume = .7
  79.  
  80. local UnsheathSound = Instance.new("Sound")
  81. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  82. UnsheathSound.Parent = sword
  83. UnsheathSound.Volume = 1
  84.  
  85.  
  86.  
  87. function blow(hit)
  88. local humanoid = hit.Parent:findFirstChild("Humanoid")
  89. local vCharacter = Tool.Parent
  90. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  91. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  92. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  93.  
  94. tagHumanoid(humanoid, vPlayer)
  95. humanoid:TakeDamage(damage)
  96. wait(1)
  97. untagHumanoid(humanoid)
  98. end
  99. end
  100.  
  101.  
  102. function tagHumanoid(humanoid, player)
  103. local creator_tag = Instance.new("ObjectValue")
  104. creator_tag.Value = player
  105. creator_tag.Name = "creator"
  106. creator_tag.Parent = humanoid
  107. end
  108.  
  109. function untagHumanoid(humanoid)
  110. if humanoid ~= nil then
  111. local tag = humanoid:findFirstChild("creator")
  112. if tag ~= nil then
  113. tag.Parent = nil
  114. end
  115. end
  116. end
  117.  
  118.  
  119. function attack()
  120. damage = slash_damage
  121. SlashSound:play()
  122. local anim = Instance.new("StringValue")
  123. anim.Name = "toolanim"
  124. anim.Value = "Slash"
  125. anim.Parent = Tool
  126. end
  127.  
  128.  
  129. function swordUp()
  130. Tool.GripForward = Vector3.new(-1.1,0,0)
  131. Tool.GripRight = Vector3.new(0,1,0)
  132. Tool.GripUp = Vector3.new(0,0,1)
  133. end
  134.  
  135. function swordOut()
  136. Tool.GripForward = Vector3.new(0,0,1)
  137. Tool.GripRight = Vector3.new(0,-1,0)
  138. Tool.GripUp = Vector3.new(-1,0,0)
  139. end
  140.  
  141. function swordAcross()
  142. -- parry
  143. end
  144.  
  145.  
  146. Tool.Enabled = true
  147. local last_attack = 0
  148. function onActivated()
  149.  
  150. if not Tool.Enabled then
  151. return
  152. end
  153.  
  154. Tool.Enabled = false
  155.  
  156. local character = Tool.Parent;
  157. local humanoid = character.Humanoid
  158. if humanoid == nil then
  159. print("Humanoid not found")
  160. return
  161. end
  162.  
  163. t = r.Stepped:wait()
  164. attack()
  165. last_attack = t
  166.  
  167. --wait(.5)
  168.  
  169. Tool.Enabled = true
  170. end
  171.  
  172.  
  173. function onEquipped()
  174. UnsheathSound:play()
  175. end
  176.  
  177.  
  178. script.Parent.Activated:connect(onActivated)
  179. script.Parent.Equipped:connect(onEquipped)
  180.  
  181.  
  182. connection = sword.Touched:connect(blow)
  183.  
  184.  
  185.  
  186. end))
  187. LocalScript12.Name = "Local Gui"
  188. LocalScript12.Parent = Tool6
  189. Part7.Name = "Handle"
  190. Part7.Parent = Tool6
  191. Part7.BrickColor = BrickColor.new("Dark stone grey")
  192. Part7.Reflectance = 0.40000000596046
  193. Part7.Rotation = Vector3.new(-90.0299988, -0.0399999991, -35.3699989)
  194. Part7.Locked = true
  195. Part7.FormFactor = Enum.FormFactor.Plate
  196. Part7.Size = Vector3.new(1, 0.800000012, 3)
  197. Part7.CFrame = CFrame.new(-1567.85327, 1.50039995, -2444.01294, 0.815435171, 0.578847528, -0.000649310299, 0.000796274282, -3.93885717e-21, 0.999999642, 0.578847408, -0.81543535, -0.000460921437)
  198. Part7.BottomSurface = Enum.SurfaceType.Smooth
  199. Part7.TopSurface = Enum.SurfaceType.Smooth
  200. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  201. Part7.Position = Vector3.new(-1567.85327, 1.50039995, -2444.01294)
  202. Part7.Orientation = Vector3.new(-89.9499969, -125.369995, 90)
  203. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  204. SpecialMesh8.Parent = Part7
  205. SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=16198309"
  206. SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  207. SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=16198294"
  208. SpecialMesh8.MeshType = Enum.MeshType.FileMesh
  209. SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  210. Sound9.Parent = Part7
  211. Sound9.SoundId = "http://www.roblox.com/Asset/?ID=12135982"
  212. Sound9.Volume = 0.69999998807907
  213. Tool6.Name = "DeleteTool"
  214. Tool6.Parent = mas
  215. Tool6.TextureId = "http://www.roblox.com/asset?id=73241901"
  216. Tool6.GripForward = Vector3.new(-1, -0, -0)
  217. Tool6.GripPos = Vector3.new(0, 0, -0.5)
  218. Tool6.GripRight = Vector3.new(0, 1, 0)
  219. Tool6.GripUp = Vector3.new(0, 0, 1)
  220. Tool6.ToolTip = "Delete"
  221. Part7.Name = "Handle"
  222. Part7.Parent = Tool6
  223. Part7.BrickColor = BrickColor.new("Dark stone grey")
  224. Part7.Reflectance = 0.40000000596046
  225. Part7.Rotation = Vector3.new(-90.0299988, -0.0399999991, -35.3699989)
  226. Part7.Locked = true
  227. Part7.FormFactor = Enum.FormFactor.Plate
  228. Part7.Size = Vector3.new(1, 0.800000012, 3)
  229. Part7.CFrame = CFrame.new(-1567.85327, 1.50039995, -2444.01294, 0.815435171, 0.578847528, -0.000649310299, 0.000796274282, -3.93885717e-21, 0.999999642, 0.578847408, -0.81543535, -0.000460921437)
  230. Part7.BottomSurface = Enum.SurfaceType.Smooth
  231. Part7.TopSurface = Enum.SurfaceType.Smooth
  232. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  233. Part7.Position = Vector3.new(-1567.85327, 1.50039995, -2444.01294)
  234. Part7.Orientation = Vector3.new(-89.9499969, -125.369995, 90)
  235. Part7.Color = Color3.new(0.388235, 0.372549, 0.384314)
  236. SpecialMesh8.Parent = Part7
  237. SpecialMesh8.MeshId = "http://www.roblox.com/asset/?id=16198309"
  238. SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  239. SpecialMesh8.TextureId = "http://www.roblox.com/asset/?id=16198294"
  240. SpecialMesh8.MeshType = Enum.MeshType.FileMesh
  241. SpecialMesh8.Scale = Vector3.new(1.20000005, 1.20000005, 1.20000005)
  242. Sound9.Parent = Part7
  243. Sound9.SoundId = "http://www.roblox.com/Asset/?ID=12135982"
  244. Sound9.Volume = 0.69999998807907
  245. Script10.Name = "Destroy"
  246. Script10.Parent = Tool6
  247. table.insert(cors,sandbox(Script10,function()
  248. script.Parent.Activated:connect(function(mouse)
  249.  
  250. mouse.KeyUp:connect(function()
  251.  
  252. script.Parent.Handle.Touched:connect(function(hit)
  253. hit.Transparency = 0
  254. for n = 1,40 do
  255. wait()
  256. hit.BrickColor = BrickColor.Random()
  257. end
  258.  
  259. wait()
  260. hit:Destroy()
  261. end)
  262.  
  263. end)
  264.  
  265. end)
  266.  
  267.  
  268.  
  269. end))
  270. Script11.Name = "Sword Script"
  271. Script11.Parent = Tool6
  272. table.insert(cors,sandbox(Script11,function()
  273. -------- OMG HAX
  274.  
  275. r = game:service("RunService")
  276.  
  277.  
  278. local damage = 10
  279.  
  280.  
  281. local slash_damage = 10
  282.  
  283. sword = script.Parent.Handle
  284. Tool = script.Parent
  285.  
  286.  
  287. local SlashSound = Instance.new("Sound")
  288. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  289. SlashSound.Parent = sword
  290. SlashSound.Volume = .7
  291.  
  292. local UnsheathSound = Instance.new("Sound")
  293. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  294. UnsheathSound.Parent = sword
  295. UnsheathSound.Volume = 1
  296.  
  297.  
  298.  
  299. function blow(hit)
  300. local humanoid = hit.Parent:findFirstChild("Humanoid")
  301. local vCharacter = Tool.Parent
  302. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  303. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  304. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  305.  
  306. tagHumanoid(humanoid, vPlayer)
  307. humanoid:TakeDamage(damage)
  308. wait(1)
  309. untagHumanoid(humanoid)
  310. end
  311. end
  312.  
  313.  
  314. function tagHumanoid(humanoid, player)
  315. local creator_tag = Instance.new("ObjectValue")
  316. creator_tag.Value = player
  317. creator_tag.Name = "creator"
  318. creator_tag.Parent = humanoid
  319. end
  320.  
  321. function untagHumanoid(humanoid)
  322. if humanoid ~= nil then
  323. local tag = humanoid:findFirstChild("creator")
  324. if tag ~= nil then
  325. tag.Parent = nil
  326. end
  327. end
  328. end
  329.  
  330.  
  331. function attack()
  332. damage = slash_damage
  333. SlashSound:play()
  334. local anim = Instance.new("StringValue")
  335. anim.Name = "toolanim"
  336. anim.Value = "Slash"
  337. anim.Parent = Tool
  338. end
  339.  
  340.  
  341. function swordUp()
  342. Tool.GripForward = Vector3.new(-1.1,0,0)
  343. Tool.GripRight = Vector3.new(0,1,0)
  344. Tool.GripUp = Vector3.new(0,0,1)
  345. end
  346.  
  347. function swordOut()
  348. Tool.GripForward = Vector3.new(0,0,1)
  349. Tool.GripRight = Vector3.new(0,-1,0)
  350. Tool.GripUp = Vector3.new(-1,0,0)
  351. end
  352.  
  353. function swordAcross()
  354. -- parry
  355. end
  356.  
  357.  
  358. Tool.Enabled = true
  359. local last_attack = 0
  360. function onActivated()
  361.  
  362. if not Tool.Enabled then
  363. return
  364. end
  365.  
  366. Tool.Enabled = false
  367.  
  368. local character = Tool.Parent;
  369. local humanoid = character.Humanoid
  370. if humanoid == nil then
  371. print("Humanoid not found")
  372. return
  373. end
  374.  
  375. t = r.Stepped:wait()
  376. attack()
  377. last_attack = t
  378.  
  379. --wait(.5)
  380.  
  381. Tool.Enabled = true
  382. end
  383.  
  384.  
  385. function onEquipped()
  386. UnsheathSound:play()
  387. end
  388.  
  389.  
  390. script.Parent.Activated:connect(onActivated)
  391. script.Parent.Equipped:connect(onEquipped)
  392.  
  393.  
  394. connection = sword.Touched:connect(blow)
  395.  
  396.  
  397.  
  398. end))
  399. LocalScript12.Name = "Local Gui"
  400. LocalScript12.Parent = Tool6
  401. for i,v in pairs(mas:GetChildren()) do
  402. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  403. pcall(function() v:MakeJoints() end)
  404. end
  405. mas:Destroy()
  406. for i,v in pairs(cors) do
  407. spawn(function()
  408. pcall(v)
  409. end)
  410. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement