Hey all.
I just discovered loadstrings and experimented a little. I was puzzled when I saw these results.
location = loadstring(script.Parent:GetFullName()) test = loadstring("b = 5") print(location,test)
Here's my result:
nil function: 369C82A8
When I ran it without the test
variable, it returned nil
- Which is probably the same with the test variable. what I expected was workspace.Part
for location
and 5 for test.
Can someone please clarify loadstrings for me?
Thanks
You recieved that output due to the fact that loadstring returns a function. You still have to call this function in order to play your code. What you did was created the function to call, and then printed it.
Try it this way;
loadstring("test = 5")() loadstring("location = script.Parent:GetFullName()")() print(test,location)