KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 01:45 PM |
I have a bunch of different scripts In some scripts, I use the same _G like this
_G.lol = game.Workspace.Brick
_G.lol.Transparency = 1
Should I take out the _G if its in the same script?
|
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 01:45 PM |
| _G is a variable, I think. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 22 Feb 2014 01:48 PM |
| LOL get owned. If it is in the same script, take it out there is no use. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 01:50 PM |
I use it in different scripts as well.
GET PWNED! |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 22 Feb 2014 01:51 PM |
| Then no.... this is simple stuff. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
|
| 22 Feb 2014 01:54 PM |
| If you define a variable with _G in front of it, you always have to use the _G, even if it is in the same script. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 01:55 PM |
Did you raed my script?
11:55:18.179 - Players.Player1.PlayerGui.Game.LocalScript:7: attempt to concatenate global 'tankvar' (a nil value) |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 01:56 PM |
script:
_G.tankvar = 0
for i = 20,1,-1 do wait (3) game.Lighting.Unit:Clone().Parent = script.Parent script.Parent.Unit.Name = script.Parent.Unit.Name..tankvar _G.tankvar = tankvar + 1 _G.Targeter = script.Parent.Unit.._G.tankvar end
|
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 01:57 PM |
oh I think I found it
ROBLOX Forum » Game Creation and Development » Scripting Helpers Home Search MyForums Reply to Post Original Post Re: Trouble with _G Posted by KEVEKEV77 on 02-22-2014 01:56 PM script:
_G.tankvar = 0
for i = 20,1,-1 do wait (3) game.Lighting.Unit:Clone().Parent = script.Parent script.Parent.Unit.Name = script.Parent.Unit.Name..tankvar _G.tankvar = tankvar + 1
lol this part ^ |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 22 Feb 2014 01:58 PM |
| _G.tankvar = _G.tankvar + 1 |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
| |
|