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 |
|
|
|
| 16 Aug 2013 02:14 PM |
| Are you sure the script.Parent bit is the correct number? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 01 Aug 2011 |
| Total Posts: 681 |
|
| |
|
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 |
|
|