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 » Scripters
Home Search
 

Re: On touched help needed.

Previous Thread :: Next Thread 
TheDeveloperYoshi is online. TheDeveloperYoshi
Joined: 12 Aug 2015
Total Posts: 795
05 Sep 2017 11:12 PM
Brick = script.Parent

Brick.Touched:connect(function()
game.Workspace.Block.Transparency = 1
end)


What would I need to do to make it to where if the part is no longer touched, it does certain code?


R+://899893970 "I'm a better Yoshi than you." [ATR]
Report Abuse
TheDeveloperYoshi is online. TheDeveloperYoshi
Joined: 12 Aug 2015
Total Posts: 795
05 Sep 2017 11:16 PM
pl0x


R+://899893970 "I'm a better Yoshi than you." [ATR]
Report Abuse
TheDeveloperYoshi is online. TheDeveloperYoshi
Joined: 12 Aug 2015
Total Posts: 795
05 Sep 2017 11:18 PM
I lonelyz...


R+://899893970 "I'm a better Yoshi than you." [ATR]
Report Abuse
DreamlandFire is not online. DreamlandFire
Joined: 25 Mar 2013
Total Posts: 170
05 Sep 2017 11:20 PM
I don't really think you can do that, actually. If it's necessary for the object to be touched first, you could use loops and bools to check if it's still being touched and activate the code only when it's no longer being touched, but if that's not essential, just make it so that it runs the code automatically and only changes when it's being touched.

A good decision is based on knowledge and not on numbers. -Plato
Report Abuse
TheDeveloperYoshi is online. TheDeveloperYoshi
Joined: 12 Aug 2015
Total Posts: 795
05 Sep 2017 11:34 PM
But how does Roblox know if the part is no longer being touched?


R+://899893970 "I'm a better Yoshi than you." [ATR]
Report Abuse
Fluent_Lua is not online. Fluent_Lua
Joined: 03 Oct 2011
Total Posts: 1290
05 Sep 2017 11:54 PM
TouchEnded

http://wiki.roblox.com/index.php?title=API:Class/BasePart/TouchEnded


#code Do not give up; the beginning is always the hardest part.
Report Abuse
Fluent_Lua is not online. Fluent_Lua
Joined: 03 Oct 2011
Total Posts: 1290
05 Sep 2017 11:55 PM
Brick = script.Parent

Brick.Touched:connect(function()
game.Workspace.Block.Transparency = 1
end)

Brick.TouchEnded:connect(function()
--some piece of code
print("pr00f it works")
end)


#code Do not give up; the beginning is always the hardest part.
Report Abuse
TheDeveloperYoshi is online. TheDeveloperYoshi
Joined: 12 Aug 2015
Total Posts: 795
05 Sep 2017 11:59 PM
Wow, it actually worked! Thank you so much. You deserve a full chocolate m&m cookie.


R+://899893970 "I'm a better Yoshi than you." [ATR]
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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