#How do i make something go down when a trigger is touched?

8 messages · Page 1 of 1 (latest)

proven nymph
#

and then it goes back up when something else is touched

frosty valleyBOT
#

studio** You are now Level 2! **studio

lament hawk
#

utilize the touched event and tween service

proven nymph
#

what

dark sky
#

wait

#

let me retype this.

#

TouchStarted or/and TouchEnded; you will use on both objects to prevent bugs, a brief description of this:

Example: Part one gets touched, you will use an if statement to check if what touched the part contains a humanoid to be sure its a player. (don't use an if statement if you're using non-player objects to touch the part) Once it knows it contains a humanoid if it does, it will use TweenService to move the position of part one higher.

Part two gets touched, you will also repeat the same process of using an if statement to check if what touched the part contains a humanoid, if so, it will then do the exact same thing, but instead of moving it up it will move it down.

To prevent bugs you will need an extra bit of code making sure that part one and part two when being touched, don't both tween up and down or attempt to. You can do this by putting another if statement checking if the opposite part is being touched for both scripts.

I hope this helps!

#

Let me know if you would like some code to help guide you on completing it.