generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Welding A Tool

Previous Thread :: Next Thread 
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
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
LuckyProgrammer is not online. LuckyProgrammer
Joined: 14 Aug 2012
Total Posts: 55
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
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
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
LuckyProgrammer is not online. LuckyProgrammer
Joined: 14 Aug 2012
Total Posts: 55
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
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
08 Nov 2012 07:04 PM
Wait, I still don't understand, how you are making the player hold the sword.
Report Abuse
LuckyProgrammer is not online. LuckyProgrammer
Joined: 14 Aug 2012
Total Posts: 55
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
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
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
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
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
LuckyProgrammer is not online. LuckyProgrammer
Joined: 14 Aug 2012
Total Posts: 55
11 Nov 2012 09:11 AM
I know, that exactly what I was trying to say.
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
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
thek00lkid is not online. thek00lkid
Joined: 18 Jun 2011
Total Posts: 2778
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
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
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
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
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
FreeToTake is not online. FreeToTake
Joined: 21 Apr 2010
Total Posts: 1827
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
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
11 Nov 2012 11:33 AM
OK, Thanks. I got everything to work!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image