ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 29 May 2015 09:39 PM |
this is actually extremely annoying since it's pretty simple but doesn't want to work... here's the code; local player = script.Parent.Parent.Parent.Parent
while wait() do if player.Name == "Player1" then script.Parent.MFrame.Visible = true end end
does anyone see anything wrong..? |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 29 May 2015 09:40 PM |
Tell my what output says:
while wait() do if player.Name == "Player1" then script.Parent.MFrame.Visible = true else print("You messed up.") end end |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 09:42 PM |
First of all, the player's name will never change, thus using an infinite loop to check it continuously is kinda pointless.
Secondly, if you're doing GUI stuff, you probably should use a LocalScript. And in that case, player = game.Players.LocalPlayer
Thirdly, are you getting any errors in the output? |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
| |
|
|
| 29 May 2015 09:42 PM |
| Are you sure the player is named Player1? I have instances where it was just Player for some reason. |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 29 May 2015 09:43 PM |
| It was Player but then I noticed it changed into Player1. |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 29 May 2015 09:44 PM |
Oh wait lol I totally messed up fixing your script, try this instead:
if player.Name == "Player1" then script.Parent.MFrame.Visible = true else print("You didn't put in the right name.") end end |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 29 May 2015 09:46 PM |
| I actually did put the right name. I just checked. |
|
|
| Report Abuse |
|
|
Klink45
|
  |
| Joined: 06 Jun 2011 |
| Total Posts: 26054 |
|
|
| 29 May 2015 09:51 PM |
| Anyway, are there any errors when you run your script? |
|
|
| Report Abuse |
|
|
ehern11
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1541 |
|
|
| 29 May 2015 09:52 PM |
| actually putting it in a local script helped fix my problem. thank you guys. |
|
|
| Report Abuse |
|
|