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: Errors? Help spot them.

Previous Thread :: Next Thread 
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 08:39 AM
I am very new to scripting. I decided that OnTouched door was too boring to start with, so I did this. IT is not all one script, it is a whole model with three main bricks, door and two buttons. Each button has a script, I described it best as posible.





--Script for ButtonA (Opening door)
function onClicked()
script.Parent.BrickColor.new("New Yeller")
script.Parent.Parent.Door.Transparency = 1
script.Parent.Parent.Door.CanCollide = false
wait(3)
script.Parent.BrickColor.new("Bright green")
end
--End of ButtonA.



script.Parent.ClickDetector.MouseClick:connect(onClicked)
--In a different brick. ~ Script for ButtonB (Closing door)
function onClicked()
script.Parent.BrickColor.new("New Yeller")
script.Parent.Parent.Door.Transparency = 0
script.Parent.Parent.Door.CanCollide = true
wait(3)
script.Parent.BrickColor.new("Bright red")
end
--End of ButtonB.


script.Parent.ClickDetector.MouseClick:connect(onClicked)
--Layout:
--Model (The door & all bricks in this script)
--Model named "DoorFrame" (Has the frame -Non-important.
--Frame1
--Frame2
--Frame3
--Frame4
--Frame5 ~ None of these are involved in script.
--ButtonA
--ClickDetector
--Mesh
--Script (For ButtonA)
--ButtonB
--Mesh
--ClickDetector
--Script (For ButtonB)
--Door (Main part; nothing inside but a BlockMesh.)


-NCISrox
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 08:48 AM
Is someone going to help? Or should I just go back to BH?
-NCISrox
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
24 Dec 2011 08:54 AM
[ Content Deleted ]
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 08:55 AM
Whoops. :3
-NCISrox
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 08:57 AM
I only messes that up in the forum. It's fine on the real script.
--Script for ButtonA (Opening door)
function onClicked()
script.Parent.BrickColor.new("New Yeller")
script.Parent.Parent.Door.Transparency = 1
script.Parent.Parent.Door.CanCollide = false
wait(3)
script.Parent.BrickColor.new("Bright green")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--End of ButtonA.



--In a different brick. ~ Script for ButtonB (Closing door)
function onClicked()
script.Parent.BrickColor.new("New Yeller")
script.Parent.Parent.Door.Transparency = 0
script.Parent.Parent.Door.CanCollide = true
wait(3)
script.Parent.BrickColor.new("Bright red")
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)
--End of ButtonB.


--Layout:
--Model (The door & all bricks in this script)
--Model named "DoorFrame" (Has the frame -Non-important.
--Frame1
--Frame2
--Frame3
--Frame4
--Frame5 ~ None of these are involved in script.
--ButtonA
--ClickDetector
--Mesh
--Script (For ButtonA)
--ButtonB
--Mesh
--ClickDetector
--Script (For ButtonB)
--Door (Main part; nothing inside but a BlockMesh.)



-NCISrox
Report Abuse
imike218 is not online. imike218
Joined: 28 Nov 2010
Total Posts: 350
24 Dec 2011 09:06 AM
everything looks fine to me, but thats just meh
Report Abuse
rangersmash is not online. rangersmash
Joined: 18 Nov 2009
Total Posts: 2891
24 Dec 2011 09:08 AM
[ Content Deleted ]
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 09:08 AM
The door didn't work.
-NCISrox
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 09:09 AM
Thanks ranger, I will see if that works.
-NCISrox
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 09:20 AM
Didn't work. :(
-NCISrox
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 12:14 PM
Paul, tell me what I did wrong. I took it to SH, took them three hours to post something, and their only correction was changing one line; they changed this:
script.Parent.BrickColor.new("New Yeller")
to
script.Parent.BrickColor = BrickColor.new("New Yeller")






--Script for ButtonA (Opening door)

function onClicked()
script.Parent.BrickColor = BrickColor.new("New Yeller")
script.Parent.Parent.Door.Transparency = 1
script.Parent.Parent.Door.CanCollide = false
wait(3)
script.Parent.BrickColor = BrickColor.new("Bright green")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

--End of ButtonA.





--In a different brick. ~ Script for ButtonB (Closing door)

function onClicked()
script.Parent.BrickColor = BrickColor.new("New Yeller")
script.Parent.Parent.Door.Transparency = 0
script.Parent.Parent.Door.CanCollide = true
wait(3)
script.Parent.BrickColor = BrickColor.new("Bright red")
end

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

--End of ButtonB.





--Layout:
--Model (The door & all bricks in this script)
--Model named "DoorFrame" (Has the frame -Non-important.
--Frame1
--Frame2
--Frame3
--Frame4
--Frame5 ~ None of these are involved in script.
--ButtonA
--ClickDetector
--Mesh
--Script (For ButtonA)
--ButtonB
--Mesh
--ClickDetector
--Script (For ButtonB)
--Door (Main part; nothing inside but a BlockMesh.)
-NCISrox
Report Abuse
NCISrox is not online. NCISrox
Joined: 04 Jun 2010
Total Posts: 5184
24 Dec 2011 12:15 PM
Whoos. wrong thread. *Takes ejector seat back to BH*
-NCISrox
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