Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Are global functions used anymore?

Asked by 7 years ago

Are _G Values used anymore for data? Example

_G.Cash = Instance.new('IntValue')
_G.Cash.Value = 100

-- instead of

local cash = Instance.new('IntValue')
cash.Value = 100

0
Using events is a far better option than using global functions Vulkarin 581 — 7y
0
Please give an example of like events Kaosinfusedknight 36 — 7y
0
You can also use ModuleScripts instead of _G chess123mate 5873 — 7y

1 answer

Log in to vote
1
Answered by
Vulkarin 581 Moderation Voter
7 years ago

Here's some decent references for events

A remote event is useful for client-server/server-client communications http://wiki.roblox.com/index.php?title=Remote_Events_and_Functions

A bindable event is useful for server-server communications http://wiki.roblox.com/index.php?title=API:Class/BindableEvent&redirect=no

Scripting helpers even made their own guide(s) https://scriptinghelpers.org/guides/server-client-relationship-in-roblox https://scriptinghelpers.org/guides/how-to-use-remoteevents-properly

0
Oh i know how to use them, but does _G work well in filtering enabled, I get you can refer player as a parameter in them is that why? Kaosinfusedknight 36 — 7y
0
_G is just inefficient in general and I would advise not using it Vulkarin 581 — 7y
0
There is one _G variable per machine so the _G variable on the server would be different from the _G variable on each client. RayCurse 1518 — 7y
Ad

Answer this question