generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Trouble with _G

Previous Thread :: Next Thread 
KEVEKEV77 is not online. 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
MrEpicRules is not online. MrEpicRules
Joined: 06 Jul 2011
Total Posts: 5073
22 Feb 2014 01:45 PM
_G is a variable, I think.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Feb 2014 01:45 PM
You thought wrong
Report Abuse
L0cky2013 is not online. 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 is not online. 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 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
22 Feb 2014 01:51 PM
Then no.... this is simple stuff.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Feb 2014 01:52 PM
no to what
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
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 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Feb 2014 01:54 PM
I have......
Report Abuse
KEVEKEV77 is not online. 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 is not online. 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 is not online. 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 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
22 Feb 2014 01:58 PM
_G.tankvar = _G.tankvar + 1
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
22 Feb 2014 02:04 PM
I pointed that out
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image