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

Datastore problem? Value not allowed?

Asked by 10 years ago

[Edited]

01local scriptService = game:GetService("ScriptContext")
02local ds = game:GetService("DataStoreService")
03local errorLogs = ds:GetOrderedDataStore("ErrorLogs")
04 
05local function errorDetected(message,trace,brokenScript)
06    print("Error detected: "..tostring(message))
07    local key = tostring(math.floor(os.time()))
08    pcall(function() errorLogs:UpdateAsync(key, function() return {Script = brokenScript:GetFullName(),Error = message,Trace = trace} end) end)
09end
10 
11game.Workspace.RemoteFunction.OnServerInvoke = function(...) errorDetected(select(2,...)) end
12scriptService.Error:connect(errorDetected)

Look at dat efficiency :p

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

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.

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

Answer this question