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
 

Code Door Gui

Previous Thread :: Next Thread 
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
16 Aug 2013 02:12 PM
Not sure why it isn't working. No output.

code = 1492
function onClicked()
if script.Parent.Parent.TextBox.Text == code then
game.Workspace.Door.Transparency = 0.5
game.Workspace.Door.CanCollide = false
wait(2)
game.Workspace.Door.Transparency = 0
game.Workspace.Door.CanCollide = true
end
end
script.Parent.MouseButton1Down:connect(onClicked)
Report Abuse
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
16 Aug 2013 02:14 PM
Are you sure the script.Parent bit is the correct number?
Report Abuse
ProfitMargin is not online. ProfitMargin
Joined: 01 Aug 2013
Total Posts: 285
16 Aug 2013 02:15 PM
Maybe because you are matching a string value with a integer value.

1) Make sure that the TextBox/Button has no text just the pure number
2) and the do code = "1492"
Report Abuse
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
16 Aug 2013 02:15 PM
Also.. you could try instead of if script.Parent.Parent.TextButton.Text == code.. Change code to the actuall code.. even though it sounds stupid.
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
16 Aug 2013 02:16 PM
Uhh.. yes i believe i'm right, 'cause the script is inside a submit button so script.Parent.Parent will lead to the gui and then the textbox is inside the gui
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
16 Aug 2013 02:17 PM
it works with strings like "hi" should i put the number as a string?
Report Abuse
thepizz is not online. thepizz
Joined: 05 Mar 2011
Total Posts: 2612
16 Aug 2013 02:18 PM
code = 1337
script.Parent.MouseButton1Down:connect(function()
if script.Parent.Parent.TextButton.Text == tostring(code) then
game.Workspace.Door.Transparency = 0.5
game.Workspace.Door.CanCollide = false
wait(3)
game.Workspace.Door.Transparency = 0
game.Workspace.Door.CanCollide = true
end
end)
Report Abuse
DjBadyBoy is not online. DjBadyBoy
Joined: 01 Aug 2011
Total Posts: 681
16 Aug 2013 02:18 PM
oh okay thanks
Report Abuse
thepizz is not online. thepizz
Joined: 05 Mar 2011
Total Posts: 2612
16 Aug 2013 02:20 PM
A string is not the same as a number.
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