Advertisement
mr2meows

ssewhwsh

Mar 11th, 2023 (edited)
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.14 KB | None | 0 0
  1. -- Objects To Lua Make By HairBaconGamming --
  2. local Module_Scripts = {}
  3. local LinkedSword = Instance.new("Tool")
  4. local Handle = Instance.new("Part")
  5. local Mesh = Instance.new("SpecialMesh")
  6. local SwordSlash = Instance.new("Sound")
  7. local SwordLunge = Instance.new("Sound")
  8. local Unsheath = Instance.new("Sound")
  9. local SwordScript = Instance.new("Script")
  10. local MouseIcon = Instance.new("LocalScript")
  11.  
  12. -- Properties --
  13.  
  14. LinkedSword.Grip = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0)
  15. LinkedSword.GripForward = Vector3.new(-1, -0, -0)
  16. LinkedSword.GripPos = Vector3.new(0, 0, -1.5)
  17. LinkedSword.GripRight = Vector3.new(0, 1, 0)
  18. LinkedSword.GripUp = Vector3.new(0, 0, 1)
  19. LinkedSword.Name = [[LinkedSword]]
  20. LinkedSword.Parent = owner.Backpack
  21. LinkedSword.TextureId = [[rbxassetid://10010810327]]
  22.  
  23. Handle.BottomSurface = Enum.SurfaceType.Smooth
  24. Handle.BrickColor = BrickColor.new([[Dark stone grey]])
  25. Handle.CFrame = CFrame.new(13.2380266, 1.88733482, -17.8422318, 0.0910440385, -0.881099463, 0.464084357, 0.537011683, 0.435894847, 0.722229123, -0.838648558, 0.183463722, 0.512845576)
  26. Handle.Color = Color3.new(0.388235, 0.372549, 0.384314)
  27. Handle.Locked = true
  28. Handle.Name = [[Handle]]
  29. Handle.Orientation = Vector3.new(-46.2400016784668, 42.13999938964844, 50.93000030517578)
  30. Handle.Parent = LinkedSword
  31. Handle.Position = Vector3.new(13.23802661895752, 1.8873348236083984, -17.84223175048828)
  32. Handle.Reflectance = 0.4000000059604645
  33. Handle.Rotation = Vector3.new(-54.619998931884766, 27.649999618530273, 84.0999984741211)
  34. Handle.Size = Vector3.new(1, 0.800000011920929, 4)
  35. Handle.TopSurface = Enum.SurfaceType.Smooth
  36.  
  37. Mesh.MeshId = [[rbxassetid://10010809816]]
  38. Mesh.Scale = Vector3.new(0.06286, 0.06672, 0.04929)
  39. Mesh.MeshType = Enum.MeshType.FileMesh
  40. Mesh.Parent = Handle
  41. Mesh.TextureId = [[rbxassetid://10010810327]]
  42.  
  43. SwordSlash.Name = [[SwordSlash]]
  44. SwordSlash.Parent = Handle
  45. SwordSlash.SoundId = [[http://www.roblox.com/asset/?id=12222216]]
  46. SwordSlash.Volume = 0.699999988079071
  47.  
  48. SwordLunge.Name = [[SwordLunge]]
  49. SwordLunge.Parent = Handle
  50. SwordLunge.SoundId = [[http://www.roblox.com/asset/?id=12222208]]
  51. SwordLunge.Volume = 0.6000000238418579
  52.  
  53. Unsheath.Name = [[Unsheath]]
  54. Unsheath.Parent = Handle
  55. Unsheath.SoundId = [[http://www.roblox.com/asset/?id=12222225]]
  56. Unsheath.Volume = 1
  57.  
  58. function SwordScript_ScriptfakeXD()
  59.  
  60. local script = Instance.new("Script",LinkedSword)
  61. SwordScript = script
  62. script.Name = [[SwordScript]]
  63. local require_fake = require
  64. local require = function(Object)
  65. local functiom = Module_Scripts[Object]
  66. if functiom then
  67. return functiom()
  68. end
  69. return require_fake(Object)
  70. end
  71.  
  72. --Rescripted by Luckymaxer
  73. --EUROCOW WAS HERE BECAUSE I MADE THE PARTICLES AND THEREFORE THIS ENTIRE SWORD PRETTY AND LOOK PRETTY WORDS AND I'D LIKE TO DEDICATE THIS TO MY FRIENDS AND HI LUCKYMAXER PLS FIX SFOTH SWORDS TY LOVE Y'ALl
  74. --Updated for R15 avatars by StarWars
  75. --Re-updated by TakeoHonorable
  76.  
  77. Tool = script.Parent
  78. Handle = Tool:WaitForChild("Handle")
  79.  
  80. function Create(ty)
  81. return function(data)
  82. local obj = Instance.new(ty)
  83. for k, v in pairs(data) do
  84. if type(k) == 'number' then
  85. v.Parent = obj
  86. else
  87. obj[k] = v
  88. end
  89. end
  90. return obj
  91. end
  92. end
  93.  
  94. local BaseUrl = "rbxassetid://"
  95.  
  96. Players = game:GetService("Players")
  97. Debris = game:GetService("Debris")
  98. RunService = game:GetService("RunService")
  99.  
  100. DamageValues = {
  101. BaseDamage = 5,
  102. SlashDamage = 10,
  103. LungeDamage = 30
  104. }
  105.  
  106. --For R15 avatars
  107. Animations = {
  108. R15Slash = 522635514,
  109. R15Lunge = 522638767
  110. }
  111.  
  112. Damage = DamageValues.BaseDamage
  113.  
  114. Grips = {
  115. Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
  116. Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
  117. }
  118.  
  119. Sounds = {
  120. Slash = Handle:WaitForChild("SwordSlash"),
  121. Lunge = Handle:WaitForChild("SwordLunge"),
  122. Unsheath = Handle:WaitForChild("Unsheath")
  123. }
  124.  
  125. ToolEquipped = false
  126.  
  127. --For Omega Rainbow Katana thumbnail to display a lot of particles.
  128. for i, v in pairs(Handle:GetChildren()) do
  129. if v:IsA("ParticleEmitter") then
  130. v.Rate = 20
  131. end
  132. end
  133.  
  134. Tool.Grip = Grips.Up
  135. Tool.Enabled = true
  136.  
  137. function IsTeamMate(Player1, Player2)
  138. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  139. end
  140.  
  141. function TagHumanoid(humanoid, player)
  142. local Creator_Tag = Instance.new("ObjectValue")
  143. Creator_Tag.Name = "creator"
  144. Creator_Tag.Value = player
  145. Debris:AddItem(Creator_Tag, 2)
  146. Creator_Tag.Parent = humanoid
  147. end
  148.  
  149. function UntagHumanoid(humanoid)
  150. for i, v in pairs(humanoid:GetChildren()) do
  151. if v:IsA("ObjectValue") and v.Name == "creator" then
  152. v:Destroy()
  153. end
  154. end
  155. end
  156.  
  157. function Blow(Hit)
  158. if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
  159. return
  160. end
  161. local RightArm = Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand")
  162. if not RightArm then
  163. return
  164. end
  165. local RightGrip = RightArm:FindFirstChild("RightGrip")
  166. if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
  167. return
  168. end
  169. local character = Hit.Parent
  170. if character == Character then
  171. return
  172. end
  173. local humanoid = character:FindFirstChildOfClass("Humanoid")
  174. if not humanoid or humanoid.Health == 0 then
  175. return
  176. end
  177. local player = Players:GetPlayerFromCharacter(character)
  178. if player and (player == Player or IsTeamMate(Player, player)) then
  179. return
  180. end
  181. UntagHumanoid(humanoid)
  182. TagHumanoid(humanoid, Player)
  183. humanoid:TakeDamage(Damage)
  184. end
  185.  
  186.  
  187. function Attack()
  188. Damage = DamageValues.SlashDamage
  189. Sounds.Slash:Play()
  190.  
  191. if Humanoid then
  192. if Humanoid.RigType == Enum.HumanoidRigType.R6 then
  193. local Anim = Instance.new("StringValue")
  194. Anim.Name = "toolanim"
  195. Anim.Value = "Slash"
  196. Anim.Parent = Tool
  197. elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
  198. local Anim = Tool:FindFirstChild("R15Slash")
  199. if Anim then
  200. local Track = Humanoid:LoadAnimation(Anim)
  201. Track:Play(0)
  202. end
  203. end
  204. end
  205. end
  206.  
  207. function Lunge()
  208. Damage = DamageValues.LungeDamage
  209.  
  210. Sounds.Lunge:Play()
  211.  
  212. if Humanoid then
  213. if Humanoid.RigType == Enum.HumanoidRigType.R6 then
  214. local Anim = Instance.new("StringValue")
  215. Anim.Name = "toolanim"
  216. Anim.Value = "Lunge"
  217. Anim.Parent = Tool
  218. elseif Humanoid.RigType == Enum.HumanoidRigType.R15 then
  219. local Anim = Tool:FindFirstChild("R15Lunge")
  220. if Anim then
  221. local Track = Humanoid:LoadAnimation(Anim)
  222. Track:Play(0)
  223. end
  224. end
  225. end
  226.  
  227. if CheckIfAlive() then
  228. local e = Instance.new("Explosion", workspace)
  229. e.Position = Torso.Position
  230. end
  231.  
  232.  
  233. wait(0.2)
  234. Tool.Grip = Grips.Out
  235. wait(0.6)
  236. Tool.Grip = Grips.Up
  237.  
  238. Damage = DamageValues.SlashDamage
  239. end
  240.  
  241. Tool.Enabled = true
  242. LastAttack = 0
  243.  
  244. function Activated()
  245. if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
  246. return
  247. end
  248. Tool.Enabled = false
  249. local Tick = RunService.Stepped:wait()
  250. if (Tick - LastAttack < 0.2) then
  251. Lunge()
  252. else
  253. Attack()
  254. end
  255. LastAttack = Tick
  256. --wait(0.5)
  257. Damage = DamageValues.BaseDamage
  258. local SlashAnim = (Tool:FindFirstChild("R15Slash") or Create("Animation"){
  259. Name = "R15Slash",
  260. AnimationId = BaseUrl .. Animations.R15Slash,
  261. Parent = Tool
  262. })
  263.  
  264. local LungeAnim = (Tool:FindFirstChild("R15Lunge") or Create("Animation"){
  265. Name = "R15Lunge",
  266. AnimationId = BaseUrl .. Animations.R15Lunge,
  267. Parent = Tool
  268. })
  269. Tool.Enabled = true
  270. end
  271.  
  272. function CheckIfAlive()
  273. 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)
  274. end
  275.  
  276. function Equipped()
  277. Character = Tool.Parent
  278. Player = Players:GetPlayerFromCharacter(Character)
  279. Humanoid = Character:FindFirstChildOfClass("Humanoid")
  280. Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
  281. if not CheckIfAlive() then
  282. return
  283. end
  284. ToolEquipped = true
  285. Sounds.Unsheath:Play()
  286. end
  287.  
  288. function Unequipped()
  289. Tool.Grip = Grips.Up
  290. ToolEquipped = false
  291. end
  292.  
  293. Tool.Activated:Connect(Activated)
  294. Tool.Equipped:Connect(Equipped)
  295. Tool.Unequipped:Connect(Unequipped)
  296.  
  297. Connection = Handle.Touched:Connect(Blow)
  298.  
  299. end
  300. coroutine.wrap(SwordScript_ScriptfakeXD)()
  301.  
  302.  
  303. function MouseIcon_ScriptfakeXD()
  304.  
  305. local script = Instance.new("LocalScript",LinkedSword)
  306. MouseIcon = script
  307. script.Name = [[MouseIcon]]
  308. local require_fake = require
  309. local require = function(Object)
  310. local functiom = Module_Scripts[Object]
  311. if functiom then
  312. return functiom()
  313. end
  314. return require_fake(Object)
  315. end
  316.  
  317. --Made by Luckymaxer
  318.  
  319. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  320. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  321.  
  322. Tool = script.Parent
  323.  
  324. Mouse = nil
  325.  
  326. function UpdateIcon()
  327. if Mouse then
  328. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  329. end
  330. end
  331.  
  332. function OnEquipped(ToolMouse)
  333. Mouse = ToolMouse
  334. UpdateIcon()
  335. end
  336.  
  337. function OnChanged(Property)
  338. if Property == "Enabled" then
  339. UpdateIcon()
  340. end
  341. end
  342.  
  343. Tool.Equipped:Connect(OnEquipped)
  344. Tool.Changed:Connect(OnChanged)
  345.  
  346.  
  347. end
  348. coroutine.wrap(MouseIcon_ScriptfakeXD)()
  349.  
  350.  
  351. -- End --
  352. -- Thank for using --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement