|
| 05 Mar 2014 03:51 PM |
Some kind of function thing that triggers when a error occurs? This would be incredibly useful for me..
Output.ErrorOccured:connect(function() print'Hello' end) |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 03:54 PM |
Yes.
http://wiki.roblox.com/index.php?title=Error_(Event) |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Mar 2014 03:56 PM |
| Thanks for the link, but can you provide me a loop to constantly check for a script error? But only a error from GameScript? |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 03:56 PM |
| There is an event that allows you to capture all output also but I don't remember what it is named. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 03:56 PM |
"Constantly check for an error"
That function runs every time an error happens why would you need a loop? |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 03:58 PM |
| Oh, perhaps. lol, but I only want it to do the required code if a certain script errors. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 03:58 PM |
| The event fires every time there is an error. You can check for just one script by using the script Instance in the function parameters. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:01 PM |
| This script might be just what I'm lookin' for.. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:05 PM |
Ill make it an example:
the_script = workspace.MyScript
game:GetService("ScriptContext").Error:connect(function(message, trace, script) if script.Name == the_script then print("DA EPIK SCRIPT FAILED TO RUN") end end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Mar 2014 04:08 PM |
@StealthKing95 You can't compare a String to userdata in Lua. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:08 PM |
| The argument is not a string |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:09 PM |
WAIT HAHHAHAHAHAHAHA
Sorry. |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:09 PM |
hey op,
change:
if script.Name == the_script then
to:
if script.Name == the_script.Name then |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:10 PM |
the_script = workspace.MyScript
if script.Name == the_script then
The name of the script is a String
The variable the_script is an instance |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:10 PM |
What does 'op' mean?
I never knew what it stood for. |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Mar 2014 04:12 PM |
Ohh, in that case. I just used the template from the wikia, and modified it.
Thank you all! I am so glad there is a event / function for Errors! |
|
|
| Report Abuse |
|
|
|
| 05 Mar 2014 04:13 PM |
| Well yes you should be glad its only been usable for a month or so |
|
|
| Report Abuse |
|
|
| |
|
|
| 05 Mar 2014 04:28 PM |
| If my strategy with this script works, and they remove it, I am going to melt into a milion tiny blocks. |
|
|
| Report Abuse |
|
|