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: Button Making! Please Help!

Previous Thread :: Next Thread 
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
13 Aug 2013 06:41 PM
How can I make a button like the ones in p0rtal games? Like, when you stand or put a box on it a door opens, but when you get off or take the box off it closes? I have somewhat of an idea on how to do this but I am new to scripting for the most part. Thanks a lot helpers.
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
13 Aug 2013 06:41 PM
-Touched
-TouchEnded
Report Abuse
Salinas23 is not online. Salinas23
Joined: 28 Dec 2008
Total Posts: 37141
13 Aug 2013 07:01 PM
@Inf

TouchEnded? Wow never heard of that
thx

==Salinas23, LMaDer since August 2012! Scripter since July 2013!
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
13 Aug 2013 07:01 PM
ye np
Report Abuse
MHebes is not online. MHebes
Joined: 04 Jan 2013
Total Posts: 2278
13 Aug 2013 07:02 PM
Someone told me in another thread that TouchEnded doesn't fire if the player disconnects while touching the Part, so use Workspace:FindPartsInRegion3() instead, or check magnitude.

~ Oh, I'm sorry, did I break your concentration? ~
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
13 Aug 2013 07:04 PM
^

Possible to deteck player with magnitude without looping through the players?
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
13 Aug 2013 07:31 PM
Ok these things sound helpful but I am really BAD at scripting and I can hardly understand how to apply Touch and TouchEnded. Give me some scripts please.
Report Abuse
73EPIC311 is not online. 73EPIC311
Joined: 28 Aug 2012
Total Posts: 454
13 Aug 2013 08:10 PM
script.Parent.Touched:connect(function(hit)
-- What you want to do here
end)

script.Parent.TouchedEnded:connect(function()
--What you want here
end)

Put each in a seperate script inside the button.
Report Abuse
Clayguy247 is not online. Clayguy247
Joined: 03 Sep 2008
Total Posts: 3394
13 Aug 2013 08:12 PM
@infocus maybe just loop a magnitude check while its being touched, so if the player walks away touchEnded stops the loop, and if the player disconnects the magnitude loops goes "return end" or "break" whatever goats your float
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
13 Aug 2013 08:22 PM
So, what do you guys think about Epics post? Is that going to work properly?
Report Abuse
73EPIC311 is not online. 73EPIC311
Joined: 28 Aug 2012
Total Posts: 454
13 Aug 2013 08:25 PM
It should...
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
13 Aug 2013 08:27 PM
[ Content Deleted ]
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
13 Aug 2013 08:35 PM
The following didn't work when put into 2 separate scripts that were put into the button.

script.Parent.Touched:connect(function(hit)
script.Parent.BrickColor = BrickColor.new("Hot pink")
end

script.Parent.TouchedEnded:connect(function()
script.Parent.BrickColor = BrickColor.new("Really red")
end
Report Abuse
73EPIC311 is not online. 73EPIC311
Joined: 28 Aug 2012
Total Posts: 454
13 Aug 2013 08:36 PM
the ends need a )
Report Abuse
corncob567 is not online. corncob567
Joined: 18 Jan 2011
Total Posts: 795
13 Aug 2013 10:18 PM
Ok, did that and it works better. The thing is, when I stand on it, it turns hot pink like it should, but when I get off and or get off and get back on, it still remain hot pink when it should be turning back to really red.
Report Abuse
73EPIC311 is not online. 73EPIC311
Joined: 28 Aug 2012
Total Posts: 454
16 Aug 2013 02:36 PM
Add a wait(0.1)
Report Abuse
Masterkungfu980 is not online. Masterkungfu980
Joined: 18 Dec 2012
Total Posts: 35
16 Aug 2013 10:58 PM
Make a door and a button group it then put this in button
Function onTouched (hit)
script.Parent.Parent.Door.Transparency = 1
script.Parent.Parent.Door.CanCollide = false
wait (4)
script.Parent.Parent.Door.Transparency = 0.1
script.Parent.Parent.Door.CanCollide = true
end

script.Parent.touched:connect(onTouched)

Reply if it doesnt work
It makes it so when you hit the button the door will disappear
I think this is what you want
Report Abuse
Masterkungfu980 is not online. Masterkungfu980
Joined: 18 Dec 2012
Total Posts: 35
16 Aug 2013 11:08 PM
Uncapitalize function by the way
Report Abuse
shooter06 is not online. shooter06
Joined: 13 Jan 2011
Total Posts: 7443
16 Aug 2013 11:14 PM
[ Content Deleted ]
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