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: Opening a door when clicking a brick.

Previous Thread :: Next Thread 
Truste135 is not online. Truste135
Joined: 26 Oct 2010
Total Posts: 741
26 Sep 2012 04:52 AM
Ok, so I'm trying to make it when you click a specific brick, it find the door, and opens it.
I made this so far:

function onClicked()
game.Workspace:FindFirstChild("Door")
if found then
game.Workspace.Door.CanCollide = true
game.Workspace.Door.Transparency = 0.5
wait(9)
game.Workspace.Door.CanCollide = false
game.Workspace.Door.Transparency = 0
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)


Does this work?
Report Abuse
gogoboots1 is not online. gogoboots1
Joined: 13 Jun 2009
Total Posts: 65
26 Sep 2012 06:41 AM
If you try it and it doesn't work then the answer is no.
Report Abuse
AdvorsusDuo is not online. AdvorsusDuo
Joined: 17 May 2012
Total Posts: 5265
26 Sep 2012 06:51 AM
function onClicked()
local found = game.Workspace:FindFirstChild("Door")
if found then --never defined 'found'
game.Workspace.Door.CanCollide = true
game.Workspace.Door.Transparency = 0.5
wait(9)
game.Workspace.Door.CanCollide = false
game.Workspace.Door.Transparency = 0
end
end --missed an end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
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