This is my script:
file = loadfile("C:/local.lua") file()
I coped this from the roblox Function dump/Functions specific to Roblox and only changed the file to load but when I run the script I get an error "An error occured" and an error line under the word 'loadfile' in the script editor - error: W002: Global 'loadfile' is deprecated. Is there a way to fix this?
loadfile() was replaced by require() and its not used like that you need to give it a directory like script.Parent or game.ServerScriptService.Script here is how you would use the new one
function module() print("Congratulations you used this correctly") end return module
local file=require(script.Parent.ModuleScript) file()