Advertisement
oopsrainbow4

Equip and Unequip Sword Part 1 in ServerScriptService

Jul 20th, 2022
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.82 KB | None | 0 0
  1. game.Players.PlayerAdded:Connect(function(Player)
  2.     Player.CharacterAdded:Connect(function(Character)
  3.         local Case = script.Case:Clone()
  4.         Case:SetPrimaryPartCFrame(Character.HumanoidRootPart.CFrame)
  5.         Case.Parent = Character
  6.        
  7.         local weld = Instance.new("ManualWeld")
  8.         weld.Part0 = Case.PrimaryPart
  9.         weld.Part1 = Character.PrimaryPart
  10.         weld.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
  11.         weld.Parent = weld.Part0
  12.        
  13.         local Sword = script.Katana:Clone()
  14.         Sword:SetPrimaryPartCFrame(Case.Case.CFrame * CFrame.new(0,-.125,2.65))
  15.         Sword.Parent = Character
  16.        
  17.         local weld2 = Instance.new("ManualWeld")
  18.         weld2.Name = "SideWeld"
  19.         weld2.Part0 = Sword.PrimaryPart
  20.         weld2.Part1 = Case.PrimaryPart
  21.         weld2.C0 = weld2.Part0.CFrame:ToObjectSpace(weld2.Part1.CFrame)
  22.         weld2.Parent = weld2.Part0
  23.        
  24.     end)
  25. end)
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement