Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Datastore problem? Value not allowed?

[Edited]

local scriptService = game:GetService("ScriptContext")
local ds = game:GetService("DataStoreService")
local errorLogs = ds:GetOrderedDataStore("ErrorLogs")
 
local function errorDetected(message,trace,brokenScript)
	print("Error detected: "..tostring(message))
	local key = tostring(math.floor(os.time()))
	pcall(function() errorLogs:UpdateAsync(key, function() return {Script = brokenScript:GetFullName(),Error = message,Trace = trace} end) end)
end
 
game.Workspace.RemoteFunction.OnServerInvoke = function(...) errorDetected(select(2,...)) end
scriptService.Error:connect(errorDetected)

Look at dat efficiency :p

1 answer

error is a built-in function that acts similar to print except also causing an error and stopping execution.

You cannot save functions in data stores.


Most likely you meant to use message instead.

1 comment

0

I did notice this later on, my bad. And I replaced with message and it still didn't work, I'll edit now.

This discussion is preserved as it was. New answers, comments, and votes are closed.