Im trying to make a Server Script say something like IntValue = 1 and then the Local script has an if IntValue == 1 then statement. I tried using _G Values but it just returns 'nill' in the local script. I would really love some help with this!
I will give you an example with remoteevents:
Insert RemoteEvent in replicated storage
Localscript:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Remote = ReplicatedStorage:WaitForChild("RemoteEvent") local Value = 0 Remote.OnClientEvent:Connect(function(NewValue) Value = NewValue end)
Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Remote = ReplicatedStorage:WaitForChild("RemoteEvent") wait(7) Remote:FireAllClients(1)
In case you want to use intvalues you can just change value of them on the server and it will replicate to client as long as it's stored in place the client can access.
Here is an answer on how RemoteEvents work, here.
Wiki For RemoteEvents
Wiki For RemoteFunctions
Here is the ROBLOX Wiki for ModuleScripts
And a Developer Forum post on ModuleScripts and How They work, here.
Also, here is BindableEvents Wiki
And a BindableFunction Wiki
Hope this helps you with your research and how to use these to change values!