Dieses Skript stammt von Divo. Es lädt externe Skripte und Funktionen in Visionaire Studio. Das ist sehr praktisch: Du schreibst deine Skripte in einem Texteditor deiner Wahl und siehst das Ergebnis sofort, ohne das Skript jedes Mal in den Skripteditor von Visionaire Studio kopieren oder nach jeder kleinen Änderung das Projekt speichern zu müssen.
Wenn du fertig bist, empfehle ich, dein endgültiges Skript in Visionaire Studio einzufügen und dieses Skript wieder zu entfernen.
Skripttyp: Definition
-- * load an external script file if the file exists! * --
function loadScripts()
local f, cerror
--[[ replace folder_name & script_name with whatever you called your folders & script!
folder_name should be created inside of the project/game root folder! --]]
f, cerror = loadfile('./folder_name/script_name.lua')
if f == nil then -- checks if file exists!
print('cerror: ' .. cerror) -- prints error reason to the log file!
else
print('External script(s) have been successfully loaded!')
f()
end
end