Advertisement
lundofett

Untitled

Jan 1st, 2019
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.83 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Script1 = Instance.new("Script")
  21. SpecialMesh2 = Instance.new("SpecialMesh")
  22. Part3 = Instance.new("Part")
  23. SpecialMesh4 = Instance.new("SpecialMesh")
  24. Sound5 = Instance.new("Sound")
  25. Sound6 = Instance.new("Sound")
  26. Sound7 = Instance.new("Sound")
  27. Sound8 = Instance.new("Sound")
  28. Sound9 = Instance.new("Sound")
  29. Sound10 = Instance.new("Sound")
  30. Sound11 = Instance.new("Sound")
  31. Sound12 = Instance.new("Sound")
  32. Sound13 = Instance.new("Sound")
  33. Sound14 = Instance.new("Sound")
  34. Sound15 = Instance.new("Sound")
  35. Sound16 = Instance.new("Sound")
  36. LocalScript17 = Instance.new("LocalScript")
  37. Tool0.Name = "SkullCane"
  38. Tool0.Parent = mas
  39. Tool0.TextureId = "http://www.roblox.com/asset/?id=16433211"
  40. Tool0.Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
  41. Tool0.GripForward = Vector3.new(-1, -0, -0)
  42. Tool0.GripPos = Vector3.new(0, 0, -1.5)
  43. Tool0.GripRight = Vector3.new(0, 1, 0)
  44. Tool0.GripUp = Vector3.new(0, 0, 1)
  45. Script1.Name = "SwordScript"
  46. Script1.Parent = Tool0
  47. table.insert(cors,sandbox(Script1,function()
  48. -------- OMG HAX
  49. debris = game:GetService("Debris")
  50. r = game:service("RunService")
  51.  
  52.  
  53. local damage = math.huge
  54.  
  55.  
  56. local slash_damage = math.huge
  57.  
  58.  
  59. sword = script.Parent.Handle
  60. Tool = script.Parent
  61.  
  62.  
  63. local SlashSound = Instance.new("Sound")
  64. SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
  65. SlashSound.Parent = sword
  66. SlashSound.Volume = 1
  67.  
  68.  
  69. local UnsheathSound = Instance.new("Sound")
  70. UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
  71. UnsheathSound.Parent = sword
  72. UnsheathSound.Volume = 1
  73.  
  74. local DustSound = Instance.new("Sound")
  75. DustSound.SoundId = "http://www.roblox.com/asset/?id=16433289"
  76. DustSound.Parent = sword
  77. DustSound.Volume = 1
  78.  
  79.  
  80. function isTurbo(character)
  81. return character:FindFirstChild("RiddlingSkull") ~= nil
  82. end
  83.  
  84.  
  85. function blow(hit)
  86. local humanoid = hit.Parent:findFirstChild("Humanoid")
  87. local vCharacter = Tool.Parent
  88. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  89. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  90. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  91. -- final check, make sure sword is in-hand
  92.  
  93. local right_arm = vCharacter:FindFirstChild("Right Arm")
  94. if (right_arm ~= nil) then
  95. local joint = right_arm:FindFirstChild("RightGrip")
  96. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  97. if humanoid.Health > damage and humanoid.Health > 0 then
  98. tagHumanoid(humanoid, vPlayer)
  99. humanoid:TakeDamage(damage)
  100. else
  101. DarkKill(humanoid.Parent, humanoid, vPlayer, vCharacter)
  102. end
  103. end
  104. end
  105.  
  106.  
  107. end
  108. end
  109.  
  110. function DarkKill(character, humanoid, attacker, vChar)
  111.  
  112. if (character:FindFirstChild("ForceField") ~= nil) then return end
  113.  
  114. DustSound:Play()
  115.  
  116. local childs = character:GetChildren()
  117.  
  118. local colors = {}
  119.  
  120. tagHumanoid(humanoid, attacker)
  121. humanoid.Health = 0
  122.  
  123. for i=1,#childs do
  124. if (childs[i].className == "Part") then
  125. colors[i] = childs[i].BrickColor
  126. childs[i].BrickColor = BrickColor.new(26)
  127. childs[i].CanCollide = true
  128. childs[i].Anchored = true
  129. end
  130. if (childs[i].Name == "Head") then
  131. local m = childs[i]:FindFirstChild("Mesh")
  132. if (m ~= nil) then
  133. m:Remove()
  134. end
  135. script.SkullMesh:Clone().Parent = childs[i]
  136. childs[i].Anchored = false
  137. end
  138. end
  139.  
  140. wait(.25)
  141. local limit = 1
  142. if (isTurbo(vChar) == true) then limit = 3 end
  143.  
  144. for i=1,#childs do
  145. if (childs[i].className == "Part" and childs[i].Name ~= "Head") then
  146. for n=0,limit do
  147. local p = Instance.new("Part")
  148. p.formFactor = 2
  149. p.Size = Vector3.new(1,.4,1)
  150. p.BrickColor = BrickColor.new(26)
  151. p.Material = Enum.Material.Concrete
  152. p.TopSurface = 0
  153. p.BottomSurface = 0
  154. p.CFrame = childs[i].CFrame + Vector3.new(0,n,0)
  155. childs[i]:Remove()
  156. p.Parent = game.Workspace
  157. debris:AddItem(p, 60)
  158. end
  159. end
  160. end
  161.  
  162.  
  163. end
  164.  
  165.  
  166. function tagHumanoid(humanoid, player)
  167. local creator_tag = Instance.new("ObjectValue")
  168. creator_tag.Value = player
  169. creator_tag.Name = "creator"
  170. creator_tag.Parent = humanoid
  171. debris:AddItem(creator_tag, 1)
  172. end
  173.  
  174.  
  175. function attack()
  176. damage = slash_damage
  177. SlashSound:play()
  178. local anim = Instance.new("StringValue")
  179. anim.Name = "toolanim"
  180. anim.Value = "Slash"
  181. anim.Parent = Tool
  182. end
  183.  
  184.  
  185. function swordUp()
  186. Tool.GripForward = Vector3.new(-1,0,0)
  187. Tool.GripRight = Vector3.new(0,1,0)
  188. Tool.GripUp = Vector3.new(0,0,1)
  189. end
  190.  
  191. function swordOut()
  192. Tool.GripForward = Vector3.new(0,0,1)
  193. Tool.GripRight = Vector3.new(0,-1,0)
  194. Tool.GripUp = Vector3.new(-1,0,0)
  195. end
  196.  
  197.  
  198.  
  199. Tool.Enabled = true
  200.  
  201. function onActivated()
  202.  
  203. if not Tool.Enabled then
  204. return
  205. end
  206.  
  207. Tool.Enabled = false
  208.  
  209. local character = Tool.Parent;
  210. local humanoid = character.Humanoid
  211. if humanoid == nil then
  212. print("Humanoid not found")
  213. return
  214. end
  215.  
  216. if (isTurbo(character) == true) then
  217. slash_damage = 20
  218. else
  219. slash_damage = 15
  220. end
  221.  
  222.  
  223. attack()
  224.  
  225. wait(1)
  226.  
  227. Tool.Enabled = true
  228. end
  229.  
  230.  
  231. function onEquipped()
  232. UnsheathSound:play()
  233. end
  234.  
  235.  
  236. script.Parent.Activated:connect(onActivated)
  237. script.Parent.Equipped:connect(onEquipped)
  238.  
  239.  
  240. connection = sword.Touched:connect(blow)
  241.  
  242.  
  243.  
  244. end))
  245. SpecialMesh2.Name = "SkullMesh"
  246. SpecialMesh2.Parent = Script1
  247. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=4770583"
  248. SpecialMesh2.Scale = Vector3.new(3.20000005, 3.20000005, 3.20000005)
  249. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=4770560"
  250. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  251. Part3.Name = "Handle"
  252. Part3.Parent = Tool0
  253. Part3.CFrame = CFrame.new(-109.500053, 0.399930924, -63, 1, -0.000138141826, 5.96046448e-08, 0.000138141826, 1, 3.18323146e-12, -5.96046448e-08, 3.63797881e-12, 1)
  254. Part3.Orientation = Vector3.new(0, 0, 0.00999999978)
  255. Part3.Position = Vector3.new(-109.500053, 0.399930924, -63)
  256. Part3.Rotation = Vector3.new(0, 0, 0.00999999978)
  257. Part3.Color = Color3.new(0.388235, 0.372549, 0.384314)
  258. Part3.Size = Vector3.new(1, 0.800000012, 4)
  259. Part3.BottomSurface = Enum.SurfaceType.Smooth
  260. Part3.BrickColor = BrickColor.new("Dark stone grey")
  261. Part3.Locked = true
  262. Part3.TopSurface = Enum.SurfaceType.Smooth
  263. Part3.brickColor = BrickColor.new("Dark stone grey")
  264. Part3.FormFactor = Enum.FormFactor.Plate
  265. Part3.formFactor = Enum.FormFactor.Plate
  266. SpecialMesh4.Parent = Part3
  267. SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=12710534"
  268. SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=12710521"
  269. SpecialMesh4.MeshType = Enum.MeshType.FileMesh
  270. Sound5.Parent = Part3
  271. Sound5.SoundId = "rbxasset://sounds/swordslash.wav"
  272. Sound5.Volume = 1
  273. Sound6.Parent = Part3
  274. Sound6.SoundId = "rbxasset://sounds/unsheath.wav"
  275. Sound6.Volume = 1
  276. Sound7.Parent = Part3
  277. Sound7.SoundId = "http://www.roblox.com/asset/?id=16433289"
  278. Sound7.Volume = 1
  279. Sound8.Parent = Part3
  280. Sound8.SoundId = "rbxasset://sounds/swordslash.wav"
  281. Sound8.Volume = 1
  282. Sound9.Parent = Part3
  283. Sound9.SoundId = "rbxasset://sounds/unsheath.wav"
  284. Sound9.Volume = 1
  285. Sound10.Parent = Part3
  286. Sound10.SoundId = "http://www.roblox.com/asset/?id=16433289"
  287. Sound10.Volume = 1
  288. Sound11.Parent = Part3
  289. Sound11.SoundId = "rbxasset://sounds/swordslash.wav"
  290. Sound11.Volume = 1
  291. Sound12.Parent = Part3
  292. Sound12.SoundId = "rbxasset://sounds/unsheath.wav"
  293. Sound12.Volume = 1
  294. Sound13.Parent = Part3
  295. Sound13.SoundId = "http://www.roblox.com/asset/?id=16433289"
  296. Sound13.Volume = 1
  297. Sound14.Parent = Part3
  298. Sound14.SoundId = "rbxasset://sounds/swordslash.wav"
  299. Sound14.Volume = 1
  300. Sound15.Parent = Part3
  301. Sound15.SoundId = "rbxasset://sounds/unsheath.wav"
  302. Sound15.Volume = 1
  303. Sound16.Parent = Part3
  304. Sound16.SoundId = "http://www.roblox.com/asset/?id=16433289"
  305. Sound16.Volume = 1
  306. LocalScript17.Name = "Local Gui"
  307. LocalScript17.Parent = Tool0
  308. table.insert(cors,sandbox(LocalScript17,function()
  309. local Tool = script.Parent;
  310.  
  311. enabled = true
  312. function onButton1Down(mouse)
  313. if not enabled then
  314. return
  315. end
  316.  
  317. enabled = false
  318. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  319.  
  320. wait(1)
  321. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  322. enabled = true
  323.  
  324. end
  325.  
  326. function onEquippedLocal(mouse)
  327.  
  328. if mouse == nil then
  329. print("Mouse not found")
  330. return
  331. end
  332.  
  333. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  334. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  335. end
  336.  
  337.  
  338. Tool.Equipped:connect(onEquippedLocal)
  339.  
  340. end))
  341. for i,v in pairs(mas:GetChildren()) do
  342. v.Parent = workspace
  343. pcall(function() v:MakeJoints() end)
  344. end
  345. mas:Destroy()
  346. for i,v in pairs(cors) do
  347. spawn(function()
  348. pcall(v)
  349. end)
  350. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement