kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 19 Feb 2012 07:10 AM |
When I test my script in play solo nothing comes out in the output. So I guess it's just a random problem, please help. I don't know what's wrong with it. ~~~~~~~~~~~
BrickB = game.Workspace.BlueSpawn BrickR = game.Workspace.RedSpawn function BlingBlingBoiXD() local user = script.Parent.Parent.Parent.Parent.Parent script.Parent.Text = "Setting up teleportation." print("{Test 1/2 Correct}") wait(3) script.Parent.Text = "Teleporting!" if user.TeamColor == "Bright red" then print("{Test is complete you win!}") user.Character:MoveTo(Vector3.new(BrickR.Position.X,BrickR.Position.Y + 5,BrickR.Position.Z)) script.Parent.Parent.Parent:Destroy() end if user.TeamColor == "Bright blue" then user.Character:MoveTo(Vector3.new(BrickB.Position.X,BrickB.Position.Y + 5,BrickB.Position.Z)) script.Parent.Parent.Parent:Destroy() end end
script.Parent.MouseButton1Down:connect(BlingBlingBoiXD) |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 07:19 AM |
I see nothing wrong? Maybe it are the Parents.
local BrickB = workspace.BlueSpawn local BrickR = workspace.RedSpawn script.Parent.MouseButton1Down:connect(function() local user = script.Parent.Parent.Parent.Parent.Parent script.Parent.Text = "Setting up teleportation." print("{Test 1/2 Correct}") wait(2) script.Parent.Text = "Teleporting!" if user.TeamColor == "Bright red" then print("{Test is complete you win!}") user.Character:MoveTo(Vector3.new(BrickR.Position.X, BrickR.Position.Y + 5, BrickR.Position.Z)) script.Parent.Parent.Parent:Destroy() end if user.TeamColor == "Bright blue" then user.Character:MoveTo(Vector3.new(BrickB.Position.X, BrickB.Position.Y + 5, BrickB.Position.Z)) script.Parent.Parent.Parent:Destroy() end end) |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 07:21 AM |
When it's not working but there's still no output, it generally means a connection isn't firing or a condition isn't being successfully fulfilled.
Also, just a side note: I'd change this `end if user.TeamColor == "Bright blue" then`
to this
`elseif user.TeamColor == "Bright blue" then`.
I believe it's more efficient, as well as takes up less space. (In a long script, single lines begin to matter :P)
"It looks nice, but I sense a disturbing lack of Rainbow Dash and Fluttershy." |
|
|
| Report Abuse |
|
|
kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 19 Feb 2012 07:28 AM |
| Actaully it does have the printing done. You know the print'Test Complete' thing. |
|
|
| Report Abuse |
|
|
kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 19 Feb 2012 07:28 AM |
I think I'll try: if user.TeamColor == BrickColor.new("Bright red") then I dunno. |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 07:30 AM |
| does it work in play mode? |
|
|
| Report Abuse |
|
|
kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 19 Feb 2012 07:32 AM |
| Yesh!!! It works! It's a miracle! Thank yall' lol. XD |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 07:35 AM |
| lol I knew every thing would work (because I'm epic like that) and realized your error to be not adding a print in the second if statement. but I kept quiet to troll you... otrololo-lololo-lololo |
|
|
| Report Abuse |
|
|