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: How doesn't this script work?

Previous Thread :: Next Thread 
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 07:54 PM
r = game.Workspace.MannedRocket.Seat:findFirstChild("Humanoid")
function onTouched(Seat)
if
r~=nil
then
game.Workspace.MannedRocket.Seat.BodyVelocity.velocity = Vector3.new(0,4000,0)--This part probably broken
end
end
RocketScript.Parent.Touched:connect(onTouched)
------------------------------------------------------------------------------------------------------------------
Not sure why it doesn't work, can anyone help me?
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 07:55 PM
Next time read the output!


BodyVelocity.velocity

CAPITOLS!

BodyVelocity.Velocity
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 07:56 PM
In the properties Velocity isn't capitol..
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 07:59 PM
wtf


Anyway your whole set up is really bad. I would recomend trying simpler things for now.
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:00 PM
How do you recommend I do it? How is my format bad? I'm fairly new to scripting...as you can see.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 08:01 PM
First when the person sits on seat. Give them a tool, than in the tool On button down, Click and other things to make it do things..

Trust me its more complicated that It sounds like.
But you can try.
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:04 PM
First I just want it to go up before I do anything.
Report Abuse
SamuelKingx is not online. SamuelKingx
Joined: 27 Jan 2012
Total Posts: 3472
09 Jan 2014 08:04 PM
RocketScript.Parent.Touched:connect(onTouched)

Is 'RocketScript' defined?
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:04 PM
So is there anything else wrong with it?
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 08:05 PM
"it to go up"?

I still would recommend what I said becuase you would have to remove the script you made.
Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
09 Jan 2014 08:05 PM
"I'm fairly new to scripting"

*Looks at username*

ANYWAYS THE PROBLEM IS THAT r is NIL.
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:06 PM
Rocketscript is in a part, if thats what your asking.
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:08 PM
R is nil if nobody is touching it. If someone touched it, it isn't nil anymore, therefore it should liftoff.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 08:09 PM
You have to have it never nil.
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:09 PM
That script is way easier to make than a fully controlled vehicle. If I can't get it to simple go up, I can't really do anything with it.
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:10 PM
If its never nil then it'd takeoff as soon as the game loads, not what I want.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 08:12 PM
...
I will fix it

function onTouched(part)
wait(1)
if part.Parent:FindFirstChild("Humanoid")then
script.Parent.BodyVelocity.velocity = Vector3.new(0,4000,0)
script.Parent.BodyVelocity.maxforce = Vector3.new(0,10000,0)4
end
script.Parent.Touched:connect(onTouched)


Okay perfect.

Report Abuse
VoidShredder is not online. VoidShredder
Joined: 06 Jan 2014
Total Posts: 1467
09 Jan 2014 08:13 PM
r is always nil sir. Even if a player comes along and sits on it, its still nil
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:16 PM
It isn't nil anymore if someone touches it...at least thats what I want it to do.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 08:17 PM
JUST.
USE.
MINE.

I will test it FOR you and tell you IT WORKS.
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
09 Jan 2014 08:17 PM
script.Parent.Touched:connect(function(hit)
human = hit.Parent:FindFirstChild('Humanoid') or hit.Parent.Parent:FindFirstChild('Humanoid')
if human ~= nil then
yourcode
end
end)


-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ --
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:18 PM
The script didn't work...you put a 4 next to maxforce, and there's a red line over the connection line..
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 08:18 PM
Remove the 4 at the end of the line.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
09 Jan 2014 08:19 PM
And add an end.
Report Abuse
EliteLuaScripter is not online. EliteLuaScripter
Joined: 10 Jun 2013
Total Posts: 31
09 Jan 2014 08:22 PM
You know what? I'll give it a try another day. Thanks for trying guys.
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