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: Run till touching brick

Previous Thread :: Next Thread 
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:18 AM
Okay so basically i have a button, a moving brick and a stopper i am making it so when the Button is touched the moving brick begins to move and once it reaches the stopper it stops but im stuck on a part of it.

what do i add to the until loop to make it stop when it touches the stopper?

Something like this : until movingbrick touching stopper
Report Abuse
Thaeh is not online. Thaeh
Joined: 05 Feb 2011
Total Posts: 7685
13 Jan 2014 10:20 AM
paste scripts or no help
Report Abuse
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:22 AM
Thats a little mean don't you think? Since I've clearly explained what i have done and what i need help with... Even if i paste the script you could not help me because there's nothing wrong with the script... I'm asking for assistance on a certain look i don't know how to finish. If you won't help me don't comment.
Report Abuse
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:23 AM
loop*
Report Abuse
Thaeh is not online. Thaeh
Joined: 05 Feb 2011
Total Posts: 7685
13 Jan 2014 10:23 AM
no scripts no way to implement
Report Abuse
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:24 AM
MB = script.Parent.Parent.MovingBrick
Stop = script.Parent.Parent.Stopper

function onTouched(hit)
repeat
MB.CFrame=MB.CFrame+Vector3.new( 0, 0 , -.5)
until MB -- THIS AREA IS WHERE I AM CONFUSED
end
script.Parent.Touched:connect(onTouched)
Report Abuse
Thaeh is not online. Thaeh
Joined: 05 Feb 2011
Total Posts: 7685
13 Jan 2014 10:27 AM
until MB.CFrame.x == Stop.CFrame.x - MB.CFrame.Size.x

you might want to change the minus to plus or the vectors depending on what direction and orientation they go
Report Abuse
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:30 AM
It saids Size is not a valid member
Report Abuse
Thaeh is not online. Thaeh
Joined: 05 Feb 2011
Total Posts: 7685
13 Jan 2014 10:32 AM
it's not, you have to change it to fit your game.
Report Abuse
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:35 AM
Would it not make more sense to use
until MB.Position == Stop.Position?
Report Abuse
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:35 AM
That crashes my game o-o
Report Abuse
DJSasuke1963 is not online. DJSasuke1963
Joined: 30 Nov 2012
Total Posts: 1136
13 Jan 2014 10:38 AM
What do you mean by i have to change it to fit my game... All i want is this:

Moving Brick = $
Stopper = %
Button = 0

0$ %

When Button is touched

0 $>>>>> %

until Moving brick touched Stopper

0 $%

then Moving brick stops,
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
13 Jan 2014 10:59 AM
MB = script.Parent.Parent.MovingBrick
Stop = script.Parent.Parent.Stopper

function onTouched(hit)
repeat
MB.CFrame=MB.CFrame+Vector3.new( 0, 0 , -.5)
until StopMoving
StopMoving = nil
end
script.Parent.Touched:connect(onTouched)
Stop.Touched:connect(function(hit) if hit == MB then StopMoving = true end end)

So what I editted is:
If the stopper gets touched, a function will be called. It checks whether the block which touched him is the moving block or not. If it IS the moving block, a global variable 'StopMoving' will be set to true. Then the loop knows that he has to stop moving and then it will stop moving and will set the global variable 'StopMoving' to nil again :)

Hope you understand it and I hope that it works and helps :)

~sycips~
Report Abuse
EcIiptic is not online. EcIiptic
Joined: 12 Aug 2009
Total Posts: 13737
13 Jan 2014 11:20 AM
Ugh just learn to use body position. Makes everything a lot simpler.
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