|
| 03 Aug 2015 06:06 AM |
Okay, I recently made a sword that gets welded to the player's arm. The problem is, it's very hard to configure it and I would need different scripts if I want to make another weapon for the player. My question is, are there easier ways to put bricks on the player's arm just as if it's Roblox's tool system? I'm trying to mimic Roblox's tool system using welds right now. Script: Sword = game.ServerStorage.Sword game.Players.PlayerAdded:connect(function(plr) plr.CharacterAdded:connect(function(char) local RightArm = char:FindFirstChild("Right Arm") local LeftArm = char:FindFirstChild("Left Arm") local RightLeg = char:FindFirstChild("Right Leg") local LeftLeg = char:FindFirstChild("Left Leg") local Torso1 = char:FindFirstChild("Torso") local Head1 = char:FindFirstChild("Head") RightArm.Transparency = 1 LeftArm.Transparency = 1 RightLeg.Transparency = 1 LeftLeg.Transparency = 1 Torso1.Transparency = 1 Head1.Transparency = 1 local RArm = Instance.new("Part") RArm.Size = Vector3.new(1,2,1) RArm.BrickColor = BrickColor.new("Black") RArm.FormFactor = "Symmetric" RArm.Name = "RArm" RArm.Parent = char RArm.BottomSurface = "Smooth" RArm.TopSurface = "Smooth" local RAW = Instance.new("Weld") RAW.Parent = char RAW.Part0 = RArm RAW.Part1 = RightArm --[[local Sword = Instance.new("Part") Sword.Size = Vector3.new(1,1,4) Sword.BrickColor = BrickColor.new("Really black") Sword.FormFactor = "Symmetric" Sword.Name = "Swordtemp" Sword.Parent = char Sword.BottomSurface = "Smooth" Sword.TopSurface = "Smooth" Sword.CanCollide = false ]]-- local a = Sword:Clone() a.Parent = char local SwordW = Instance.new("Weld") SwordW.Parent = char SwordW.Part0 = a SwordW.Part1 = RArm SwordW.C0 = SwordW.C0 * CFrame.new(-1,0,-1.7) SwordW.C0 = SwordW.C0 * CFrame.Angles(math.pi,0,math.pi/2) local LArm = Instance.new("Part") LArm.Size = Vector3.new(1,2,1) LArm.BrickColor = BrickColor.new("Black") LArm.FormFactor = "Symmetric" LArm.Name = "LArm" LArm.Parent = char LArm.BottomSurface = "Smooth" LArm.TopSurface = "Smooth" local LAW = Instance.new("Weld") LAW.Parent = char LAW.Part0 = LArm LAW.Part1 = LeftArm local LL = Instance.new("Part") LL.Size = Vector3.new(1,2,1) LL.BrickColor = BrickColor.new("Bright red") LL.FormFactor = "Symmetric" LL.Name = "LL" LL.Parent = char LL.BottomSurface = "Smooth" LL.TopSurface = "Smooth" local LLW = Instance.new("Weld") LLW.Parent = char LLW.Part0 = LL LLW.Part1 = LeftLeg local RL = Instance.new("Part") RL.Size = Vector3.new(1,2,1) RL.BrickColor = BrickColor.new("Bright red") RL.FormFactor = "Symmetric" RL.Name = "RL" RL.Parent = char RL.BottomSurface = "Smooth" RL.TopSurface = "Smooth" local RLW = Instance.new("Weld") RLW.Parent = char RLW.Part0 = RL RLW.Part1 = RightLeg local T = Instance.new("Part") T.Size = Vector3.new(2,2,1) T.BrickColor = BrickColor.new("Bright blue") T.FormFactor = "Symmetric" T.Name = "T" T.Parent = char T.BottomSurface = "Smooth" T.TopSurface = "Smooth" local TW = Instance.new("Weld") TW.Parent = char TW.Part0 = T TW.Part1 = Torso1 local H = Instance.new("Part") H.Size = Vector3.new(2,1,1) H.BrickColor = BrickColor.new("Brick yellow") H.FormFactor = "Symmetric" H.Name = "H" H.Parent = char H.BottomSurface = "Smooth" H.TopSurface = "Smooth" local mesh = Instance.new("SpecialMesh", H) mesh.Scale = Vector3.new(1.25,1.25,1.25) local HW = Instance.new("Weld") HW.Parent = char HW.Part0 = H HW.Part1 = Head1 end) end)
Don't try using it because it won't work if you don't have the sword model I made. It simple welds bricks to the player's parts and clones the sword model I made to the player's arm. |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2015 06:43 AM |
| Make a tool, and name the part that you want the player to attach to their hand 'Handle', that is the only simple method for making a tool equip to their hand without making welds and attaching the cframes. |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2015 07:46 AM |
| I recently found out about removing the backpack service, now I'm thinking about using tools. How do I select a tool with backpack service off? |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2015 08:03 AM |
| That's a good question, I've never removed the backpack service, why would you want to remove it? |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2015 08:13 AM |
| I'm thinking about making my game only have 1 tool without seeing the tool bar or I might make a custom tool bar (See Tradelands) |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2015 08:14 AM |
| In that case, I suppose you will need to weld the handle of the tool to the player's hand... Like I said, I'm not 100% sure about this, I've never tried removing the backpack. |
|
|
| Report Abuse |
|
|
|
| 03 Aug 2015 08:22 AM |
| Any tips to effectively weld the tool to the hand? I will be having multiple items so it might not be completely aligned to the handles. |
|
|
| Report Abuse |
|
|