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: Moving forward

Previous Thread :: Next Thread 
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:15 PM
Hi, I have a water script, and I want someone to move forward whenever they touch the water. I put this script inside the water, and it's supposed to make the player move forward when they touch the water. However, the output gives me this error message at line 4,

attempt to multiply a Vector3 with an incompatible value type or nil; returning new zero-vector

The script:

1 function onTouched(hit)
2 h = hit.Parent:findFirstChild("Humanoid")
3 if (h~=nil) then
4 h.Parent.Torso.Velocity = h.Parent.Torso.CFrame.lookVector *
5 CFrame.Angles(0, 0, 0)
6 end
7 end
8
9 script.Parent.Touched:connect(onTouched)
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
20 Apr 2014 03:18 PM

local speed = 10
h.Parent.Torso.Velocity = h.Parent.Torso.CFrame.lookVector * speed
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:22 PM
It's not giving me an error message anymore, but now it doesn't do anything when I touch the water.
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:25 PM
Sorry, I fixed my 2nd problem. However there is another problem, instead of sending me forwards when I touch the water, it sends me backwards.
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
20 Apr 2014 03:25 PM
So make the speed a negative number.
Report Abuse
ZeroHour66 is not online. ZeroHour66
Joined: 14 Sep 2013
Total Posts: 1511
20 Apr 2014 03:26 PM
or just rotate the water so the back is in the front and the front is in the back
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
20 Apr 2014 03:29 PM
Just add velocity to the brick lol

I got pecked by TWO chicken's!
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:29 PM
Both ideas didn't work...
Please help someone.
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
20 Apr 2014 03:31 PM
ADD VELOCITY TO THE BRICK ITS A BASIC CFRAME LIKE BASIS, MIDDLE = UP SIDES = 1 OR -1 SAME METHOD IS IT THAT HARD!?

I got pecked by TWO chicken's!
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:32 PM
McChicken, can you please tell/show me how to do that?
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:38 PM
Sorry about the post before this, I meant to send it before your rage post. Also I
don't understand a word you are saying.
What's a Cframe like basis??
MIDDLE = UP SIDES = 1 OR -1
What's an up sides?

(I'm not being sarcastic, I'm really confused)
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
20 Apr 2014 03:43 PM
Ok, so click the brick, there is properties, add velocity heres direcetions


Middle = Up velocity

Right, using -SPEED is forward.
Right, Not minus, backwards.
Left, Opissite
Left, Oppisite



:DD

I got pecked by TWO chicken's!
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:51 PM
....Why are there two rights and two lefts?

















I'm an idiot
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
20 Apr 2014 03:55 PM
No. theres front back left and right. lol and thens theres veloicty sends you very high up.

I got pecked by TWO chicken's!
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 03:59 PM
Okay, I've got the water's cancollide set to false, but now whenever I touch the brick it only sends me halfway inside, then it stops moving me. I don't want to set the speed too high, because then they will swim too fast. Is there any way to keep moving while inside the brick?
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
20 Apr 2014 04:00 PM
Yes, have a/the brick under be the one with velocity.

I got pecked by TWO chicken's!
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 04:09 PM
This is very confusing.
I have a big water brick with the velocity of (-1000,10,1000).
Underneath it, I have a floor brick with the script in it. Now, when I jump in, it pushes me forward a bit, and I am inside the brick instead of being pushed forward some more. Please help.
Report Abuse
McChicken72 is not online. McChicken72
Joined: 09 Feb 2013
Total Posts: 1115
20 Apr 2014 04:11 PM
Look make the water you want to have velocity, post it here, and when i get time, i'll add it, i cant promise it wi'll be today though. probably tomorrow.

I got pecked by TWO chicken's!
Report Abuse
pivot513 is not online. pivot513
Joined: 09 Nov 2012
Total Posts: 328
20 Apr 2014 04:16 PM
If you're sure then here. Thanks so much, I've been stuck on this for weeks.
http://www.roblox.com/Le-ocean-place?id=111851119
Be warned, it's really big.
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