MrCherrys
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 13469 |
|
|
| 29 Aug 2014 03:39 PM |
Well, basically I'm trying to make it so that when the client goes near the brick, the GUI appears with transparency but all it does is flashes when I join the game. And hwne you go away from the brick, the GUI goes away with transparency.
Do you know what's wrong with this? No Output.
button = script.Parent
while true do for i,v in pairs(game.Players:GetPlayers()) do if (v.Character.Torso.Position - button.Position).magnitude <= 5 then for GuiReveal = 1, 0, -0.05 do v.PlayerGui.InstructionGui.Label.TextTransparency = GuiReveal wait() end end if (v.Character.Torso.Position - button.Position).magnitude >= 5 then for GuiReveal = 0, 1, 0.05 do v.PlayerGui.InstructionGui.Label.TextTransparency = GuiReveal wait() end end end wait() end |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2014 03:41 PM |
It's simple.
Read your code with more depth. There's a loop running almost every frame. And as long as the player from the first for loop is in the magnitude, ANOTHER LOOP is created to animate the GUI transparency. EVERY TIME THE LOOP RUNS
So it's created a new loop to animate almost every 1/30th second you are in range. |
|
|
| Report Abuse |
|
|
MrCherrys
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 13469 |
|
|
| 29 Aug 2014 03:46 PM |
| Well, tbh I don't understand anything about scripting but I'm pretty intermedite (fail spell I guess) at scripting. Could you maybe modify it or somewhat? |
|
|
| Report Abuse |
|
|
MrCherrys
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 13469 |
|
| |
|
|
| 29 Aug 2014 04:08 PM |
button = script.Parent
while true do for i,v in pairs(game.Players:GetPlayers()) do;Spawn(wait) if (v.Character.Torso.Position - button.Position).magnitude <= 5 then for GuiReveal = 1, 0, -0.05 do v.PlayerGui.InstructionGui.Label.TextTransparency = GuiReveal wait() end end if (v.Character.Torso.Position - button.Position).magnitude >= 5 then for GuiReveal = 0, 1, 0.05 do v.PlayerGui.InstructionGui.Label.TextTransparency = GuiReveal wait() end end end wait() end |
|
|
| Report Abuse |
|
|
MrCherrys
|
  |
| Joined: 28 Apr 2010 |
| Total Posts: 13469 |
|
|
| 29 Aug 2014 04:36 PM |
| Doesn't work like that. My output says that the symbol ';' is unexpected. |
|
|
| Report Abuse |
|
|