i want to call _G.H = (mouse.hit)
from a local script in a regular script by using
print (Vector3.new(_G.H.X,_G.H.Y,_G.H.Z))
but it gives me the error message ServerScriptService.ChangeScript:8: attempt to index field 'H' (a nil value)
It is impossible to do so. A RemoteEvent
, much less a RemoteFunction
, won't help you either. Both RemoteEvents and RemoteFunctions replicate objects across the server/client boundary, and because _G
can't be replicated across that boundary, you cannot transfer it to a local script from a server (normal) script. You can use _G
separately on the client (it behaves the same way it behaves on the server), but you can't transfer it unless you use BindableEvents or BindableFunctions between server or local scripts.