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 » Roblox » All Things ROBLOX
Home Search
 

Re: Scripting detectors

Previous Thread :: Next Thread 
GriffinDorr is not online. GriffinDorr
Joined: 14 Dec 2009
Total Posts: 7
12 Apr 2015 11:40 PM
I am new to scripting and i would like to script a detector that would slide something then when the detector is not being touched it would go back the way it was before

this is the script im using to slide it to the first position:

keyboard = script.Parent.Parent.KeyBoard
plank = script.Parent.Parent.Plank
screen = script.Parent.Parent.Screen.Decal
debounce= true

function onTouched(touch)
if debounce == true then
debounce = false
for i=1,4 do
keyboard.CFrame = CFrame.new(keyboard.CFrame.x + 0.5,keyboard.CFrame.y,CFrame.z)
plank.CFrame = CFrame.new(plank.CFrame.x + 0.5,plank.CFrame.y, plank.CFrame.z)
screen.Transparency = 0
wait()
end
debounce = true
end
end

script.Parent.Touched:connect(onTouched)

Please Help!
Report Abuse
careypriceispro is not online. careypriceispro
Joined: 31 Dec 2012
Total Posts: 4744
12 Apr 2015 11:41 PM
just add a free model kohl's admin script and you're set!
Report Abuse
bobbyfishstick5 is not online. bobbyfishstick5
Joined: 24 Oct 2008
Total Posts: 6713
12 Apr 2015 11:42 PM
Output?
Report Abuse
GriffinDorr is not online. GriffinDorr
Joined: 14 Dec 2009
Total Posts: 7
12 Apr 2015 11:44 PM
I don't want to add free models i want to learn how to do this properly
Report Abuse
aaron0v is not online. aaron0v
Joined: 08 Jun 2010
Total Posts: 1264
12 Apr 2015 11:46 PM
there's a scripting forum for a reason.
Report Abuse
Eternalfireeater is not online. Eternalfireeater
Joined: 01 May 2011
Total Posts: 10027
12 Apr 2015 11:47 PM
There is an OnTouchEnded event, but it's rather unreliable.
I'd recommend using invisible, non-collidable parts that detect when touched to trigger exiting.
Report Abuse
reptiledude10 is not online. reptiledude10
Joined: 16 Mar 2012
Total Posts: 29235
12 Apr 2015 11:50 PM
Try making them local variables
Report Abuse
BreakingDemons is not online. BreakingDemons
Joined: 05 Mar 2009
Total Posts: 15141
12 Apr 2015 11:53 PM
May I point out that there is no space on "debounce= true" at the top.


|| QUIT || +24284 posts || Uberbuilder98 +others ||
Report Abuse
BreakingDemons is not online. BreakingDemons
Joined: 05 Mar 2009
Total Posts: 15141
12 Apr 2015 11:54 PM
Also use local variables like the other guy said
"Local keyboard = script.Parent.Parent.KeyBoard"


|| QUIT || +24284 posts || Uberbuilder98 +others ||
Report Abuse
reptiledude10 is not online. reptiledude10
Joined: 16 Mar 2012
Total Posts: 29235
12 Apr 2015 11:54 PM
@breaking
Spaces like that dont affect anything
Report Abuse
FridayTruffle is not online. FridayTruffle
Joined: 20 Mar 2010
Total Posts: 10518
12 Apr 2015 11:55 PM
a what?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » All Things ROBLOX
   
 
   
  • 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