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: _G Global Array -- working in 'Play Solo' but not on server....

Previous Thread :: Next Thread 
Izzik is not online. Izzik
Joined: 28 Jan 2010
Total Posts: 45
17 Jul 2011 09:40 PM
So I wrote a script that defines various _G Global functions to access and alter a table in that same script. Other scripts call those _G functions. When testing using 'Play Solo' things work wonderfully. However, when starting a test server or uploading and playing on that Server, the tools using the _G functions do NOTHING.

Is there something I'm missing about global functions that would cause this to happen on a server??

Thanks
Report Abuse
Frostglacier is not online. Frostglacier
Joined: 28 Oct 2010
Total Posts: 4177
17 Jul 2011 09:41 PM
Hm, I'm not sure. Could be because of Roblox glitches...
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
17 Jul 2011 09:54 PM
Is your _G Global Array being indexed or written to on the server or the client?

Each client; the server all use different _G tables. Meaning you can't define a _G function in a server-side script and then access it from a localscript in a character.
Report Abuse
Izzik is not online. Izzik
Joined: 28 Jan 2010
Total Posts: 45
17 Jul 2011 11:09 PM
Ok, so, practical application:

A tool in a player's backpack calls blocks to come into in existence along a defined grid in the playing area. This works along with a global table made in game.Workspace. The tool checks the vector of where the new brick would appear in the global table to make sure the location is not in used already, and also registers the new location in the table.

Do I understand the above situation would not work because a) the table exists in a server side environment and b) the tool exists in a client side?

It seems to me even if I were to index the _G Array to the client side, then it would not be usable by other players as would be necessary in the above scenario. Right?

That said, what is a good solution?
Report Abuse
swmaniac is not online. swmaniac
Joined: 28 Jun 2008
Total Posts: 15773
17 Jul 2011 11:14 PM
You understand correctly.
There are several solutions of varying degrees of inefficiency.

For instance, you could add a .ChildAdded connection to where ever those blocks are being parented and call the server side function from that; use Value objects to carry over any additional data.
Report Abuse
Izzik is not online. Izzik
Joined: 28 Jan 2010
Total Posts: 45
17 Jul 2011 11:27 PM
Alrighty, that makes sense. Thanks.
Report Abuse
Izzik is not online. Izzik
Joined: 28 Jan 2010
Total Posts: 45
19 Jul 2011 07:09 PM
Is it possible to have a tool that a character can use but is housed on the server side (thus enabling a tool that can access a global array)? I thought I read somewhere that a Backpack runs both Scripts and Localscripts.....or is that another subject?
Report Abuse
Boomarang is not online. Boomarang
Joined: 15 Jul 2008
Total Posts: 919
28 Jul 2011 03:41 AM
A Backpack can run both. I'm pretty sure of it. Though, my _G script no longer works. Darn updates.
Report Abuse
UttermostExedra is not online. UttermostExedra
Joined: 28 Dec 2009
Total Posts: 2483
28 Jul 2011 04:04 AM
@boom
This is an week old thread, spammer.
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