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: No Output, but doesn't work?

Previous Thread :: Next Thread 
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
29 Dec 2013 04:22 PM

function move(m)
moving = true
while (moving) do
local position = m.Hit
local target = position.p
local origincframe = weld.C0
local dir = (target - connector.Position).unit
local spawnPos = connector.Position

local poss = spawnPos + (dir * 1)

weld.C0 = CFrame.new(poss, poss + dir)
wait(0.1)
weld.C0 = origincframe

end
end

I tried adapting a BodyGyro script that follows a mouse, to make it change welds instead to follow the mouse. Anyone know why it doesn't work? There's no output..
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
29 Dec 2013 04:40 PM
Bump.
I just want to know how to make a brick face towards where the mouse is pointing using a Weld.
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
29 Dec 2013 05:14 PM
Bump2
Report Abuse
DrRandomous is not online. DrRandomous
Joined: 25 Mar 2011
Total Posts: 1702
29 Dec 2013 05:15 PM
Have you called the function?
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
29 Dec 2013 05:16 PM
Yes. Everything in the script works except this part.
I can't seem to make a brick weld it's lookvector towards where the mouse it pointing..
Report Abuse
DrRandomous is not online. DrRandomous
Joined: 25 Mar 2011
Total Posts: 1702
29 Dec 2013 05:20 PM
Add some print()s to it, see what line it stops at.
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
29 Dec 2013 05:27 PM
I realized what I did wrong.
Anyways now I got this function to trigger, however there's an error for line 79 which is this part :
weld.C0 = CFrame.new(weld.C0, poss + dir)

The error is : Driver:79: bad argument #1 to 'new' (Vector3 expected, got userdata)
Report Abuse
DrRandomous is not online. DrRandomous
Joined: 25 Mar 2011
Total Posts: 1702
29 Dec 2013 05:30 PM
The frame needs to bits. Eg CFrame.new(0,0,0), but your doing something like (0,0)
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
29 Dec 2013 05:33 PM
function move(m)
moving = true
while (moving) do
local position = m.Hit
local target = position.p
local origincframe = weld.C0
local dir = (target - connector.Position).unit
print("target aquired")
local spawnPos = connector.Position

local poss = spawnPos + (dir * 1)

weld.C0 = CFrame.new(poss, poss + dir)
print("weld change")
wait(0.1)
weld.C0 = origincframe

end
end


Okay I did this and it ALMOST worked. One major issue though..the gun welds to a different location, I just want it to rotate in the direction of the mouse.
Report Abuse
seanb117 is not online. seanb117
Joined: 03 Feb 2010
Total Posts: 1020
29 Dec 2013 06:13 PM
Bump..
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