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

Help Loadstring help?

Asked by 8 years ago
loadstring(game:GetObjects('rbxassetid://123')[1].Source)()

What do these things do??? Like, I used to know but I quit Roblox and totally forgot scripting.

1 answer

Log in to vote
3
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
8 years ago

LoadString takes a string value and converts it to code or a function. This form of running code is extremely dangerous, as it has been linked to exploiters using the function to load unauthorized code. The LoadString function is also disabled for LocalScripts as a vulnerability with use of Admin Command Scripts has been once again utilized running unauthorized code. Basically leading to the moral of the story, this is why we can't have nice things.

LoadString has had its time but is sadly becoming deprecated as some script makers have utilized different forms of running chatted code (Epix Incorporated Server Suite for example). The LoadString function was first used in Person299's Admin Commands (by means of popularity), which soon broke leading to the creation of Kohl's Admin Commands V2 (which is also the cause for the popular crash script... Thank you Kohl /sarc), which brings you to the capabilities we have today.

LoadString works by having some sort of code in string format. Say I wanted to print "Hello", I would use a code like such.

loadstring('print("Hello")')()

Some restrictions to LoadString;

  • Can not be used in LocalScripts
  • LoadStringEnabled property of SeverScriptService must be true.
  • If LoadStringEnabled is true, PlayerPoints service becomes unusable.
  • LoadString enables vulnerabilities to your game, that can not be stressed enough.
0
loadstring isn't deprecated, or becoming deprecated. Rather, it has been imposed with more restrictions on it. Also, anything passed into load string is run as an anonymous function, so loadstring('print ("Hello, World!")')() is equivalent to (function() print("Hello, World!") end). Otherwise, detailed explanation! DigitalVeer 1473 — 8y
Ad

Answer this question