Advertisement
HowToRoblox

SwordOnLegScript

Nov 19th, 2019
5,772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. while wait() do
  2.     if script.Parent.Parent.Name == "Backpack" then
  3.         local Chararacter = script.Parent.Parent.Parent.Character
  4.        
  5.         if Chararacter then
  6.             local UpperTorso = Chararacter:FindFirstChild("UpperTorso")
  7.             local Weapon = Chararacter:FindFirstChild(script.Parent.Name)
  8.    
  9.             if UpperTorso and not Weapon then
  10.                 local WeaponOnLeg = Instance.new("Model")
  11.                 WeaponOnLeg.Name = script.Parent.Name
  12.                 WeaponOnLeg.Parent = Chararacter
  13.        
  14.                 Handle = script.Parent.Handle:Clone()
  15.                 Handle.Name = "Handle"
  16.                 Handle.Parent = WeaponOnLeg
  17.            
  18.                 local LegWeld = Instance.new("Weld")
  19.                 LegWeld.Name = "WeldOnLeg"
  20.                 LegWeld.Part0 = UpperTorso
  21.                 LegWeld.Part1 = Handle
  22.                 LegWeld.C0 = CFrame.new(1,-1.42,0.5)
  23.                 LegWeld.C0 = LegWeld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(-150),math.rad(-180),-20.5)
  24.                 LegWeld.Parent = Handle
  25.             end
  26.         end
  27.  
  28.     else
  29.         if Handle.Parent then
  30.             Handle.Parent:Destroy()
  31.         endend
  32.    
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement