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: Why wont this work?

Previous Thread :: Next Thread 
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
01 May 2012 04:14 PM
No output or anything it is in a local script.

while true do
wait(0.001)
local seat = script.Parent
local camera = Workspace.CurrentCamera.CoordinateFrame.lookVector

if seat.Throttle == 1 then
print("go!")
script.Parent.Parent.Part.BodyVelocity.velocity = camera*10
end
end
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
01 May 2012 04:16 PM
As I said, I don't believe lookvector is part of CoordinateFrame, try using CFrame.

- Cheers!
Report Abuse
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
01 May 2012 04:16 PM
It is, this works: print(Workspace.CurrentCamera.CoordinateFrame.lookVector)
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
01 May 2012 04:19 PM
Is throttle a valid member? (A.k.a is it there? Is it a bool value?)

- Cheers!
Report Abuse
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
01 May 2012 04:21 PM
Yeah it is. I have no errors in output so I'm not sure here.
Report Abuse
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
01 May 2012 04:23 PM
I even did:
while true do
wait(0.001)
print("test")
local seat = script.Parent
local camera = Workspace.CurrentCamera.CoordinateFrame.lookVector

if seat.Throttle == 1 then
print("go!")
script.Parent.Parent.Part.BodyVelocity.velocity = camera*10
end
end


Test does not show up.
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
01 May 2012 04:24 PM
This is in a LocalScript?

- Cheers!
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
01 May 2012 04:25 PM
Ignore my last post.

- Cheers!
Report Abuse
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
01 May 2012 04:25 PM
Yes.
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
01 May 2012 04:26 PM
local seat = script.Parent
local camera = Workspace.CurrentCamera.CoordinateFrame.lookvector
while wait() do
if seat:findFirstchild("Throttle").Value == 1 then -- You were missing .Value
print("go!")
script.Parent.Parent.Part.BodyVelocity.velocity = camera*10
end
end

- Cheers!
Report Abuse
MrMcAero is not online. MrMcAero
Joined: 21 Apr 2012
Total Posts: 671
01 May 2012 04:27 PM
might need to make the V in lookVector from the code I game you to a capital.

-Stupid Floodcheck

- Cheers!
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
01 May 2012 04:36 PM
It looks like the script is in something in the Workspace. Am I right? Because if I am, then that is why it won't work.
Report Abuse
chaokid9 is not online. chaokid9
Joined: 29 Aug 2008
Total Posts: 6187
01 May 2012 04:55 PM
Yeah that was my problem.
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