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

How to load a script into ROBLOX from a file on your computer?

Asked by 8 years ago

Recently I had been using HTTP and loading my scripts off of x10hosting. However recently my account was suspended because it is apparently against their rules to use their website for hosting of documents that contain scripting.

Anyway, I continued looking and gave up trying to host from a HTTP source and looked into something else that I had heard about. Apparently you can load files off your computer through ROBLOX so I looked into it.

On the ROBLOX Wiki I found the following: dofile: [(http://prntscr.com/ajfxmk)] load: [(http://prntscr.com/ajfxv3)] loadfile: [(http://prntscr.com/ajfy0s)]

The location of the file that I am trying to use is "C:\Users\Windows\Documents\ROBLOX\HTTP Scripts\BaseScripts.lua"

I tried the following:

f = loadfile["C:\Users\Windows\Documents\ROBLOX\HTTP Scripts\BaseScripts.lua"]
print(f)

Got the error: "11:38:19.956 - f = loadfile["C:\Users\Windows\Documents\ROBLOX\HTTP Scripts\BaseScripts.lua"] print(f):1: attempt to index global 'loadfile' (a function value)"

f = load["C:\Users\Windows\Documents\ROBLOX\HTTP Scripts\BaseScripts.lua"]
print(f)

Got the error: 11:37:49.335 - "f = load["C:\Users\Windows\Documents\ROBLOX\HTTP Scripts\BaseScripts.lua"] print(f):1: attempt to index global 'load' (a function value)"

f = dofile["C:\Users\Windows\Documents\ROBLOX\HTTP Scripts\BaseScripts.lua"]
print(f)

Got the error: 11:38:51.293 - f = dofile["C:\Users\Windows\Documents\ROBLOX\HTTP Scripts\BaseScripts.lua"] print(f):1: attempt to index global 'dofile' (a function value)

Please help.

0
Why are you trying to do this? BlueTaslem 18071 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

The error is that you are using square brackets instead of normal brackets. Square brackets are used for indexing a table, whereas normal ones are used for (among other things) calling a function.

Additionally, from what I can tell, Roblox doesn't support dofile. I also doubt it supports the other ones.

Also, for what reason do you wish to load scripts externally anyway?

Ad

Answer this question