Hi. I was reading the Scripting Book on wiki.roblox.com, and on chapter 7, they game me a script that is:
code = [[ p = Instance.new("Part", game.Workspace) p.Anchored = true ]]
loadstring(code)()
Can anyone explain what this means?
Hi. I was reading the Scripting Book on wiki.roblox.com, and on chapter 7, they game me a script that is:
code = [[ p = Instance.new("Part", game.Workspace) p.Anchored = true ]]
loadstring(code)()
Can anyone explain what this means?
The basic function on how this works is that it will load the code from above. The bottom code will explain it.
code = [[ p = Instance.new("Part", game.Workspace) p.Anchored = true ]] -- The code that will be called on.
loadstring(code)() -- Calls on the code, using loadstring.
Now if you would like to read more on it, here is the wiki page.
thanks this really helped!
No problem.
"code = [[ p = Instance.new("Part", game.Workspace) p.Anchored = true ]" That means that the part will be anchored, and it will not fall. "loadstring(code)()" I do not know what that means, sorry :(
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
i meant to say gave....
http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#loadstring , though I wouldn't recommend usage as it can be exploited.