Any way to send information from the server to the client without events?

Have you ever done this or has anyone ever done this before?

sfdgfdsgfsgdsfdg

Try updating all of the string values and number values before the boolvalue then update the bool value like this in the server script.

values (both string and number) = value you want here
boolValue = true
boolValue = false

Something along the lines of that.

Then in the client check if the bool value has changed. If it has check all of its children for changes.
Then try to make a dictionary using all of the strings and values.

Hope this helps!

1 Like

I have before. The idea is that you turn these CFrames, Color3s, etc into storable data, like tables, strings, and integers.

1 Like

Could you send the code or the module you use?

Were you updating the object value every heartbeat or only when data was beinng changed?

I don’t have a module you can use, I can show you an example of some serialized data though

local serializedData = { dataType = "Color3", data={r=1,g=0,b=0}}

Personally, I would be more comfortable with only changing the data when it’s changed

No I’m not talking about serializing data im talking about the http functions you would use onto the string obect value

That would look something like this then.

-- Server
local dict = {
	-- stuff
}

stringVal.Value = HttpService:JSONEncode(dict)

-- Client
stringVal.Changed:Connect(function(jsonDict)
	local dict = HttpService:JSONDecode(jsonDict)
	-- do stuff
end)
4 Likes

To bypass the 200,000 limit which I dont think ill reach but let’s say for example I have like a shop dictionary, a weapon info dictionary and let’s just say a player’s inventory dictionary

Could I just create different string value objects, for each dictionary im looking to send over to the client when I need too?

Thanks for this I managed to create a little module for just this!

image

local module = {}
local RunService = game:GetService("RunService")
local Httpservice = game:GetService("HttpService")

module.Object = script.Object

if RunService:IsServer() then
	
	module.Global = {
		Data = {},
		TempStuff = {}
	}
	
	function module.UpdateObjectValue()
		module.Object.Value = Httpservice:JSONEncode(module.Global)
	end

end

function module.Retrieve()
	if module.Object.Value ~= "" then
		return Httpservice:JSONDecode(module.Object.Value)
	else
		repeat task.wait() until module.Object.Value ~= ""
		return Httpservice:JSONDecode(module.Object.Value)
	end
end


return module
1 Like

A disclaimer:
If you’re working with truly massive dictionaries that are kilobytes in size, do not set the StringValue value rapidly with a humongous string. This will completely destroy the client’s experience due to the massive amount of data being transferred.

You should only send the massive string a single time when the client joins the game so that the client can get its copy. Afterwards, any changes made to the dictionary server-side should be replicated via a RemoteEvent with the only information being the key changed (use an array if this is nested) and the new value of the key.

1 Like

Yeah I have no plan on making massive dictionaries or anything like that, so this seems like a solid way for me to seamless send values over too the client alowing them to read it almost instantly, thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.