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: Local Vector Help!

Previous Thread :: Next Thread 
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
26 Apr 2013 11:07 AM
Okay, so using a LocalScript, I've made it Clone the Arms of your player and Into the tool, but now, how would i make them, Follow where you're aiming in first Person, E.g the Weapon and Arms go Up, when you look Up,

http://www.roblox.com/Compound-place?id=56243423

just like in that place

any help would be appreciated.
~ Band
Report Abuse
ohno1112 is not online. ohno1112
Joined: 23 Mar 2013
Total Posts: 833
26 Apr 2013 11:09 AM
use CameraVector.
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
26 Apr 2013 11:16 AM
How would I go about using CameraVector, Example please?
(I'm not experienced with Camera Things, Just CFrame Animations, and NPC's not really done anything Player sided before :P)
Report Abuse
neongoo51 is not online. neongoo51
Joined: 12 May 2009
Total Posts: 33061
26 Apr 2013 11:56 AM
If you're experienced with CFrame animations, then you should know how to use LookVectors. I think it has something with that to do.

{ERROR: Signature.exe not found}
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
26 Apr 2013 12:02 PM
I Can make an Object, (Model) Rotate and Spin(Cycle) around another Object, using LookVectors, but that Is as far as I can go with them.
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
26 Apr 2013 01:21 PM
Bump~ Still need help
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
26 Apr 2013 07:37 PM
Bump~ Still need Help
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
26 Apr 2013 11:14 PM
Bump ~ Still need help...
Report Abuse
Bloxyhead is not online. Bloxyhead
Joined: 12 Oct 2009
Total Posts: 52
27 Apr 2013 02:46 AM
haha im doing something like that right now, except how are you doing it?
im kind of using like the traditional ways of arm welding, like you know those popular gun scripts: weld33.C1 = CFrame.Angles(blah,blah,blah) stuff like that
and im making so that
in a loop
the up down angles change based on the cameravector
(hint: it uses math.sin)

but in a lot of other games, they pretty much just clone heads and arms, from a model, weld them together, and literally have them point wherever your mouse is pointing, like move them all at once, which is convenient for them i guess
its ok in fps
i know that because i look in uncopylocked games but anyways

my way is kind of wierd i guess
Report Abuse
Bloxyhead is not online. Bloxyhead
Joined: 12 Oct 2009
Total Posts: 52
27 Apr 2013 04:17 AM
k guys im done, turns out it actually uses atan2 and mouse.hit
it looks really wierd tho, so... you prob dont want to use it
otherwise it works

function onEquipped(mouse2)
mouse = mouse2

wait(0.1)
vChar = script.Parent.Parent

larmweld = Instance.new("Weld")
rarmweld = Instance.new("Weld")

lsh = vChar.Torso:findFirstChild("Left Shoulder")
rsh = vChar.Torso:findFirstChild("Right Shoulder")
if lsh ~= nil and rsh ~= nil then
lsh.Part1 = nil
rsh.Part1 = nil
end

larmweld.Part0 = vChar.Torso
larmweld.Parent = vChar.Torso
larmweld.Part1 = vChar:findFirstChild("Left Arm")

rarmweld.Part0 = vChar.Torso
rarmweld.Parent = vChar.Torso
rarmweld.Part1 = vChar:findFirstChild("Right Arm")

coroutine.resume(coroutine.create(function()
while wait(0.1) do
getWeldDirection(mouse)
end
end))
end

function getWeldDirection(mouse)
if not dug_in and sprint_on then
local dir = (mouse.Hit.p - script.Parent.Parent.Head.Position).unit
local tilt = math.deg(math.atan2(dir.y,Vector3.new(dir.x,0,dir.z).magnitude))
larmweld.C1 = CFrame.new(-0.35, 0.6, 0.6) * CFrame.Angles(math.rad(290), math.rad(0 + tilt), math.rad(-90))
rarmweld.C1 = CFrame.new(-1, 0, 0.6) * CFrame.Angles(math.rad(-90 - tilt), 0, 0)
end
end

i might actualy change the welding a bit, to like some other new, generated part, but aside from that, have fun using my low-production value extrmely inefficient script
Report Abuse
BandanaSnake is not online. BandanaSnake
Joined: 06 Feb 2010
Total Posts: 141
27 Apr 2013 02:40 PM
Thanks, but I already solved it, I had to make it slighty different, due to the Player's Arms having 2 blocks each, (They Have ElBows in my game) xD but thank you anyway, for posting the script, so others can use it :)
Report Abuse
runeblade0301 is not online. runeblade0301
Joined: 21 Oct 2012
Total Posts: 92
26 Sep 2013 06:48 PM
Is that a local script or just a script?
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