|
| 02 Jun 2015 05:59 PM |
Hello. I am making a GUI so when you click the "PLAY" button, it teleports you to 0,0,0 and then gives you a gun. Here is the problem: It works fully, but after that, when I reset and try it over again it doesn't work. Script:
script.Parent.Parent.Parent.Visible = false -- the gui turns invisible game.Lighting.Grenade.Parent = player.Character -- gives gun to player character:MoveTo(Vector3.new(0,0,0)) -- moves character to 0,0,0
this is fully made by me and I didn't use any free models so of course it wont be perfect.
I also tried this: while true do script.Parent.Parent.Parent.Visible = false -- the gui turns invisible game.Lighting.Grenade.Parent = player.Character -- gives gun to player character:MoveTo(Vector3.new(0,0,0)) -- moves character to 0,0,0 end
can anyone help me?
Remember, it works the first time, but then when I reset and click "PLAY" again, it just turns the gui invisible but does nothing else.
I'm not a rapper. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 Jun 2015 06:01 PM |
| remove the loop first, it isnt necessary |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
|
| 02 Jun 2015 06:02 PM |
What do you mean?
I'm not a rapper. |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 02 Jun 2015 06:10 PM |
local gui = script.Parent
gui.MouseButton1Click:connect(function() --code end) |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 06:10 PM |
game.Lighting.Grenade.Parent = player.Character -- gives gun to player
You are moving the Grenade, that's why it works once. Figure out the error. |
|
|
| Report Abuse |
|
|
|
| 02 Jun 2015 06:16 PM |
Thanks! The answer was right in front of my face, but I just didn't notice it...
I'm not a rapper. |
|
|
| Report Abuse |
|
|