|
| 08 Nov 2012 06:24 PM |
I am trying to make a tool-less sword. I need assistance on making the player equip the sword, like they would with normal tools.
Would I use C-Frame to do this? If so, how? If not what would I need to do? |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 06:36 PM |
Well I had tried to make tools like this, sometime they work sometime they don't, but what I did was instead equiping the sword
Mouse = Player:GetMouse()
Tool.Equipped:connect(function()
I did
Equip(Mouse) Where Equip is the name of the function. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 06:38 PM |
| Would that work when I am using :GetMouse()? I am not using any tools. Trying to make A next-Gen game. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 06:42 PM |
Yea, when making a no tool, type tool. You need to put Game.Players.LocalPlayer:GetMouse()
It will only work in a Local Script |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 07:04 PM |
| Wait, I still don't understand, how you are making the player hold the sword. |
|
|
| Report Abuse |
|
|
|
| 08 Nov 2012 07:12 PM |
When you equipped the sword normaly you press the button. Well here
function Equipped(Mouse) print 'Normal way' end Tool.Equipped:connect(Equipped)
Inside that function there usally welding and CFraming right? Copy that function but instead of Equipping the tool you use the Player:GetMouse() method and call the function
function Equipped(Mouse) print 'No tool way' end
Equipped(Player:GetMouse) |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2012 09:58 PM |
OK, I got that part now, It prints.
But how would I make them actually hold the sword? |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 09:52 AM |
Lucky, you don't need a tool at all. If you want to player to equip the sword, then simply weld it to their arm! If you want to do such with boss animation skills, check this out!
http://www.roblox.com/Interpolation-item?id=95561722 |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 09:11 AM |
| I know, that exactly what I was trying to say. |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 10:09 AM |
| OK, I tried welding it to the players arm, but I cant get it to work. I have read the wiki page on welding, but still have no idea how to do it. |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 10:53 AM |
local Weld = Instance.new("Weld") Weld.Parent = game.Players.LocalPlayer.Character.Torso Weld.Part0 = Weld.Parent Weld.Part1 = game.Players.LocalPlayer.Character:FindFirstChild("Right Arm")
Weld.C1 = CFrame.new(x,y,z)
This welds the user's arm to the torso, which allows us to edit the Coordinate Frame of both parts. C1 being the arm, C0 being the torso. |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 11:03 AM |
| I figured out how to weld the sword, but I am not sure how to make there arm stay up. Is that what that script does? |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 11:15 AM |
p = game.Players.LocalPlayer p.Character.Torso['Right Shoulder'].DesiredAngle = math.pi p.Character.Torso['Right Shoulder'].MaxVelocity = 1
dunno if this works :P you can try
for the sword, I'd say
x = the sword y = p.Character['Right Arm']
z = Instance.new("Weld",x) z.Part0 = x z.Part1 = y z.C0 = y.CFrame + y.CFrame.lookVector*y.Size.y
not sure :P |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 11:30 AM |
found out how to make put the arm up :
while true do p.Character.Torso['Right Shoulder']:SetDesiredAngle(1.57) p.Character.Torso['Right Shoulder'].MaxVelocity = 1 wait(.1) end |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 11:33 AM |
| OK, Thanks. I got everything to work! |
|
|
| Report Abuse |
|
|