hawoody

Epic Katana

Apr 21st, 2018
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.83 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. Tool0 = Instance.new("Tool")
  19. Part1 = Instance.new("Part")
  20. SpecialMesh2 = Instance.new("SpecialMesh")
  21. Sound3 = Instance.new("Sound")
  22. Sound4 = Instance.new("Sound")
  23. Sound5 = Instance.new("Sound")
  24. Sparkles6 = Instance.new("Sparkles")
  25. Sparkles7 = Instance.new("Sparkles")
  26. SpotLight8 = Instance.new("SpotLight")
  27. SpotLight9 = Instance.new("SpotLight")
  28. Script10 = Instance.new("Script")
  29. LocalScript11 = Instance.new("LocalScript")
  30. Tool0.Name = "EpicKatana"
  31. Tool0.Parent = mas
  32. Tool0.TextureId = "http://www.roblox.com/asset/?id=25265469"
  33. Tool0.GripForward = Vector3.new(-1, -0, -0)
  34. Tool0.GripPos = Vector3.new(0, 0, -1.70000005)
  35. Tool0.GripRight = Vector3.new(0, 1, 0)
  36. Tool0.GripUp = Vector3.new(0, 0, 1)
  37. Part1.Name = "Handle"
  38. Part1.Parent = Tool0
  39. Part1.BrickColor = BrickColor.new("Dark stone grey")
  40. Part1.Rotation = Vector3.new(-48.3999977, 18.9499989, 110.119995)
  41. Part1.Locked = true
  42. Part1.FormFactor = Enum.FormFactor.Custom
  43. Part1.Size = Vector3.new(1, 0.800000012, 5)
  44. Part1.CFrame = CFrame.new(-0.0445830002, 16.590107, 0.405761003, -0.32535699, -0.888061285, 0.324792504, 0.706910312, -0.000305632973, 0.707303107, -0.628029346, 0.459725142, 0.627879083)
  45. Part1.BottomSurface = Enum.SurfaceType.Smooth
  46. Part1.TopSurface = Enum.SurfaceType.Smooth
  47. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  48. Part1.Position = Vector3.new(-0.0445830002, 16.590107, 0.405761003)
  49. Part1.Orientation = Vector3.new(-45.0200005, 27.3499985, 90.0199966)
  50. Part1.Color = Color3.new(0.388235, 0.372549, 0.384314)
  51. SpecialMesh2.Parent = Part1
  52. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=11442510"
  53. SpecialMesh2.Scale = Vector3.new(1.70000005, 1.70000005, 1.70000005)
  54. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=11442524"
  55. SpecialMesh2.VertexColor = Vector3.new(0, 0, 0)
  56. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  57. SpecialMesh2.Scale = Vector3.new(1.70000005, 1.70000005, 1.70000005)
  58. Sound3.Name = "SwordLunge"
  59. Sound3.Parent = Part1
  60. Sound3.SoundId = "http://www.roblox.com/asset/?id=25256253"
  61. Sound3.Volume = 0.80000001192093
  62. Sound4.Name = "SwordSlash"
  63. Sound4.Parent = Part1
  64. Sound4.SoundId = "http://www.roblox.com/asset/?id=12222216"
  65. Sound4.Volume = 0.69999998807907
  66. Sound5.Name = "Unsheath"
  67. Sound5.Parent = Part1
  68. Sound5.SoundId = "http://www.roblox.com/asset/?id=12222225"
  69. Sound5.Volume = 1
  70. Sparkles6.Name = "Sparkles1"
  71. Sparkles6.Parent = Part1
  72. Sparkles6.Color = Color3.new(-5.3125, -40.8, 6)
  73. Sparkles6.SparkleColor = Color3.new(-3, -4, 6)
  74. Sparkles6.Color = Color3.new(-5.3125, -40.8, 6)
  75. Sparkles7.Name = "Sparkles2"
  76. Sparkles7.Parent = Part1
  77. Sparkles7.Color = Color3.new(7.08333, -10.2, 5)
  78. Sparkles7.SparkleColor = Color3.new(4, -1, 5)
  79. Sparkles7.Color = Color3.new(7.08333, -10.2, 5)
  80. SpotLight8.Name = "Light1"
  81. SpotLight8.Parent = Part1
  82. SpotLight8.Color = Color3.new(-3, -4, 6)
  83. SpotLight8.Brightness = 6
  84. SpotLight8.Range = 6
  85. SpotLight8.Angle = 180
  86. SpotLight8.Face = Enum.NormalId.Top
  87. SpotLight8.Color = Color3.new(-3, -4, 6)
  88. SpotLight9.Name = "Light2"
  89. SpotLight9.Parent = Part1
  90. SpotLight9.Color = Color3.new(4, -1, 5)
  91. SpotLight9.Brightness = 6
  92. SpotLight9.Range = 6
  93. SpotLight9.Angle = 180
  94. SpotLight9.Face = Enum.NormalId.Bottom
  95. SpotLight9.Color = Color3.new(4, -1, 5)
  96. Script10.Name = "SwordScript"
  97. Script10.Parent = Tool0
  98. table.insert(cors,sandbox(Script10,function()
  99. --Rescripted by Luckymaxer
  100.  
  101. Tool = script.Parent
  102. Handle = Tool:WaitForChild("Handle")
  103.  
  104. Sparkles1 = Handle:WaitForChild("Sparkles1")
  105. Sparkles2 = Handle:WaitForChild("Sparkles2")
  106. Light1 = Handle:WaitForChild("Light1")
  107. Light2 = Handle:WaitForChild("Light2")
  108.  
  109. Players = game:GetService("Players")
  110. Debris = game:GetService("Debris")
  111. RunService = game:GetService("RunService")
  112.  
  113. DamageValues = {
  114. BaseDamage = 15,
  115. SlashDamage = 30,
  116. LungeDamage = 42
  117. }
  118.  
  119. NormalSpeed = 16
  120. RegularSpeed = (NormalSpeed + 2)
  121.  
  122. Damage = DamageValues.BaseDamage
  123.  
  124. Grips = {
  125. Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  126. Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
  127. }
  128.  
  129. Sounds = {
  130. Slash = Handle:WaitForChild("SwordSlash"),
  131. Lunge = Handle:WaitForChild("SwordLunge"),
  132. Unsheath = Handle:WaitForChild("Unsheath")
  133. }
  134.  
  135. ToolEquipped = false
  136.  
  137. Tool.Grip = Grips.Up
  138. Tool.Enabled = true
  139.  
  140. function IsTeamMate(Player1, Player2)
  141. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  142. end
  143.  
  144. function TagHumanoid(humanoid, player)
  145. local Creator_Tag = Instance.new("ObjectValue")
  146. Creator_Tag.Name = "creator"
  147. Creator_Tag.Value = player
  148. Debris:AddItem(Creator_Tag, 2)
  149. Creator_Tag.Parent = humanoid
  150. end
  151.  
  152. function UntagHumanoid(humanoid)
  153. for i, v in pairs(humanoid:GetChildren()) do
  154. if v:IsA("ObjectValue") and v.Name == "creator" then
  155. v:Destroy()
  156. end
  157. end
  158. end
  159.  
  160. function Blow(Hit)
  161. if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
  162. return
  163. end
  164. local RightArm = Character:FindFirstChild("Right Arm")
  165. if not RightArm then
  166. return
  167. end
  168. local RightGrip = RightArm:FindFirstChild("RightGrip")
  169. if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
  170. return
  171. end
  172. local character = Hit.Parent
  173. if character == Character then
  174. return
  175. end
  176. local humanoid = character:FindFirstChild("Humanoid")
  177. if not humanoid or humanoid.Health == 0 then
  178. return
  179. end
  180. local player = Players:GetPlayerFromCharacter(character)
  181. if player and (player == Player or IsTeamMate(Player, player)) then
  182. return
  183. end
  184. UntagHumanoid(humanoid)
  185. TagHumanoid(humanoid, Player)
  186. humanoid:TakeDamage(Damage)
  187. end
  188.  
  189.  
  190. function Attack()
  191. Damage = DamageValues.SlashDamage
  192. Sounds.Slash:Play()
  193. local Anim = Instance.new("StringValue")
  194. Anim.Name = "toolanim"
  195. Anim.Value = "Slash"
  196. Anim.Parent = Tool
  197. end
  198.  
  199. function Lunge()
  200. Damage = DamageValues.LungeDamage
  201.  
  202. Sounds.Lunge:Play()
  203.  
  204. if ToolUnequipped then
  205. ToolUnequipped:disconnect()
  206. end
  207.  
  208. local CurrentlyEquipped = true
  209.  
  210. ToolUnequipped = Tool.Unequipped:connect(function()
  211. CurrentlyEquipped = false
  212. end)
  213.  
  214. local Anim = Instance.new("StringValue")
  215. Anim.Name = "toolanim"
  216. Anim.Value = "Lunge"
  217. Anim.Parent = Tool
  218.  
  219. if CheckIfAlive() then
  220. Humanoid.WalkSpeed = (NormalSpeed + 100)
  221. local Force = Instance.new("BodyVelocity")
  222. Force.velocity = Vector3.new(0, 10, 0)
  223. Force.maxForce = Vector3.new(0, 4000, 0)
  224. Debris:AddItem(Force, 0.4)
  225. Force.Parent = Torso
  226. end
  227.  
  228. wait(0.2)
  229. Tool.Grip = Grips.Out
  230. wait(0.6)
  231. Tool.Grip = Grips.Up
  232.  
  233. if ToolUnequipped then
  234. ToolUnequipped:disconnect()
  235. end
  236.  
  237. if CurrentlyEquipped and CheckIfAlive() then
  238. Humanoid.WalkSpeed = RegularSpeed
  239. end
  240.  
  241. Damage = DamageValues.SlashDamage
  242. end
  243.  
  244. Tool.Enabled = true
  245. LastAttack = 0
  246.  
  247. function Activated()
  248.  
  249. if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
  250. return
  251. end
  252.  
  253. Tool.Enabled = false
  254.  
  255. Tick = RunService.Stepped:wait()
  256.  
  257. if (Tick - LastAttack < 0.2) then
  258. Lunge()
  259. else
  260. Attack()
  261. end
  262.  
  263. LastAttack = Tick
  264.  
  265. --wait(0.5)
  266.  
  267. Tool.Enabled = true
  268. end
  269.  
  270. function CheckIfAlive()
  271. return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
  272. end
  273.  
  274. function Equipped()
  275. Character = Tool.Parent
  276. Player = Players:GetPlayerFromCharacter(Character)
  277. Humanoid = Character:FindFirstChild("Humanoid")
  278. Torso = Character:FindFirstChild("Torso")
  279. if not CheckIfAlive() then
  280. return
  281. end
  282. ToolEquipped = true
  283. Humanoid.WalkSpeed = RegularSpeed
  284. Sounds.Unsheath:Play()
  285. end
  286.  
  287. function Unequipped()
  288. Tool.Grip = Grips.Up
  289. if CheckIfAlive() then
  290. Humanoid.WalkSpeed = NormalSpeed
  291. end
  292. ToolEquipped = false
  293. end
  294.  
  295. Tool.Activated:connect(Activated)
  296. Tool.Equipped:connect(Equipped)
  297. Tool.Unequipped:connect(Unequipped)
  298.  
  299. Connection = Handle.Touched:connect(Blow)
  300.  
  301. function SetSparkles(Table)
  302. for i, v in pairs(Table) do
  303. if v and v.Sparkles and v.Sparkles.Parent then
  304. local SparkleColor = ((v.Sparkles == Sparkles1 and (((v.Color and v.Color) or Color3.new(math.random(-5, 5), math.random(-10, 12), math.random(0, 15)))) or (v.Sparkles == Sparkles2 and ((v.Color and v.Color) or Color3.new(math.random(-21, 12), math.random(-2, 3), math.random(-20, 15))))))
  305. v.Sparkles.SparkleColor = SparkleColor
  306. if v.Light and v.Light.Parent then
  307. v.Light.Color = SparkleColor
  308. end
  309. end
  310. end
  311. end
  312.  
  313. Spawn(function()
  314. SetSparkles({{Sparkles = Sparkles1, Light = Light1, Color = Color3.new(1, 1, 1)}, {Sparkles = Sparkles2, Light = Light2, Color = Color3.new(1, 0, 1)}})
  315. while true do
  316. wait(3)
  317. SetSparkles({{Sparkles = Sparkles1, Light = Light1}, {Sparkles = Sparkles2, Light = Light2}})
  318. end
  319. end)
  320. end))
  321. LocalScript11.Name = "MouseIcon"
  322. LocalScript11.Parent = Tool0
  323. table.insert(cors,sandbox(LocalScript11,function()
  324. --Made by Luckymaxer
  325.  
  326. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  327. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  328.  
  329. Tool = script.Parent
  330.  
  331. Mouse = nil
  332.  
  333. function UpdateIcon()
  334. if Mouse then
  335. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  336. end
  337. end
  338.  
  339. function OnEquipped(ToolMouse)
  340. Mouse = ToolMouse
  341. UpdateIcon()
  342. end
  343.  
  344. function OnChanged(Property)
  345. if Property == "Enabled" then
  346. UpdateIcon()
  347. end
  348. end
  349.  
  350. Tool.Equipped:connect(OnEquipped)
  351. Tool.Changed:connect(OnChanged)
  352.  
  353. end))
  354. for i,v in pairs(mas:GetChildren()) do
  355. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  356. pcall(function() v:MakeJoints() end)
  357. end
  358. mas:Destroy()
  359. for i,v in pairs(cors) do
  360. spawn(function()
  361. pcall(v)
  362. end)
  363. end
Add Comment
Please, Sign In to add comment