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 » Game Design
Home Search
 

Re: How do I change this into a click activated brick?

Previous Thread :: Next Thread 
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
26 Mar 2015 12:41 AM
So this is a cframe door opening script. This script only activates the door opening script but I was wondering how do I change this into a click activated brick. I tried just changing the touch commands onto click commands but it doesn't work for some reason. So what do I have to do to change this script so it activates when I click it? Here's the script:

local dooropener = script.DoorOpener:Clone()
local deb = true

function onTouch(hit)
if not deb then return end
deb = false
local opener = dooropener:Clone()
opener.Disabled = false
opener.Parent = script.Parent.Parent.Door
repeat
wait(2)
until opener.Parent == nil
deb = true
end

script.Parent.Button.Touched:connect(onTouch)
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
27 Mar 2015 12:01 AM
So does anyone know?
Report Abuse
Sypr is not online. Sypr
Joined: 14 Feb 2013
Total Posts: 556
27 Mar 2015 12:03 AM
i thought i replyed to this
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
27 Mar 2015 12:06 AM
No you didn't.
Report Abuse
Septamology is not online. Septamology
Joined: 20 Jun 2013
Total Posts: 2811
27 Mar 2015 05:48 AM
local cd = Instance.new('ClickDetector',script.Parent)

local dooropener = script.DoorOpener:Clone()
local deb = true

function click()
if not deb then return end
deb = false
local opener = dooropener:Clone()
opener.Disabled = false
opener.Parent = script.Parent.Parent.Door
repeat
wait(2)
until opener.Parent == nil
deb = true
end

cd.MouseClick:connect(click)




Septamology - R$344 - Tx1,213
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
27 Mar 2015 06:20 PM
Now it doesn't work at all.
Report Abuse
Septamology is not online. Septamology
Joined: 20 Jun 2013
Total Posts: 2811
27 Mar 2015 06:26 PM
Well, I tried. Don't be so stubborn, people are actually trying to help you.


Septamology - R$228 - Tx1,649
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
27 Mar 2015 06:39 PM
Well I've tried to just replace the touch commands to click commands but that doesn't work. I just don't understand how it can work when you touch it but doesn't work when you click it.
Report Abuse
InfectionCreator is not online. InfectionCreator
Joined: 23 Apr 2010
Total Posts: 25
27 Mar 2015 06:41 PM
Show me the set up you have like:

door
-script
-other stuff
--more stuff
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
27 Mar 2015 06:48 PM
-sliding door --model
speed --value
speed2 --value
Door --model
door--part
Touch --model
Script --this is the script that I want to have activated on click
DoorOpener --script
Button --part
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
27 Mar 2015 07:13 PM
give me da model. i fix.
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
27 Mar 2015 07:42 PM
Ok it's in my models as a free model.
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
28 Mar 2015 12:23 PM
take it. in my models.
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
28 Mar 2015 04:50 PM
I have a bit of a problem with your door. So what happens is when I click in it it moves however what I want to have happen is for the door to move forward and then wait 2 seconds and then move back to its original position which is does however the problem is if I click on it again and again before it's moved back it keeps moving forward. So bascially I want it to move just once when the player clicks the button and then be unable to move until it moves back to its original position. Would adding debounce help?
Report Abuse
krisk7 is not online. krisk7
Joined: 24 Aug 2013
Total Posts: 254
28 Mar 2015 04:54 PM
Actually nvm. I added debounce and it fixed the problem and now it works prefectly. Thank you very much.
Report Abuse
TheNewChicken is not online. TheNewChicken
Joined: 18 Mar 2015
Total Posts: 1997
28 Mar 2015 05:13 PM
welcome.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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