generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: loadstring question

Previous Thread :: Next Thread 
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
09 Feb 2014 10:01 PM
Is it possible to alter things within loadstring after it has been called? For example say I made a ban script inside of a loadstring, but then I wanted to unban the player, is it possible?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
09 Feb 2014 11:49 PM
Yes its possible, but you'll have to call loadstring again.
Think of it like this. The string is a word document. You print out the word document and turn it in to your teacher. Now, you can go home and change the word document right? But what you turned in to your teacher remains the same.
Same concept here.
Besides how would you alter the string? ._.
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
09 Feb 2014 11:50 PM
I mean, I know I can add more to the loadstring, but will that effect what is already in place? I realize I could just use a table to ban people, but say I used their Name or userId, no way to clear it is there?
Report Abuse
dogwarrior24 is not online. dogwarrior24
Joined: 10 Nov 2010
Total Posts: 1401
09 Feb 2014 11:52 PM
loadstring adds to the current script, the answer is yes.
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
09 Feb 2014 11:52 PM
But I could do something like this and it would work right?

loadstring(

local banned = {"jakej78b"}
Game.Players.PlayerAdded:connect(function(p)
for _,v in pairs(banned) do
if p.Name == v then
p:Kick()
end
end
end)
)()

loadstring(

table.remove(banned,1)
)()
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
09 Feb 2014 11:53 PM
Okay, you said I could do it, so how would I use another loadstring to undo the action of this loadstring:

loadstring(
Game.Players.PlayerAdded:connect(function(p)
if p.Name == "jakej78b" then
p:Kick()
end
end)
)()
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
09 Feb 2014 11:54 PM
Ya stuff like that would work. I thought you meant like edit the text of code that already executed.
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
09 Feb 2014 11:57 PM
Yeah I do mean text of code that already executed, lol. Just kinda new to loadstring and want to see what all works. Also, loadstring will pick up right where it left off right? SO I could do something like this:

loadstring(a="Hi broth")()
loadstring(ers and sisters" print(a) -- -> Hi Brothers and sisters
)()
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
09 Feb 2014 11:59 PM
Also, sorry for so many question but so new so many question... Does loadstring last forever once you write to it? Or once you remove the script that contains it does it go away?
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
10 Feb 2014 12:02 AM
Nevermind on all of it, I just learned how to read and now I see the loadstring is simply the same thing as typing in script, just an alternative method that is used when no other way is possible.
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
10 Feb 2014 12:07 AM
Where did you learn loadstring? I think its about time I learn it too.
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
10 Feb 2014 12:20 AM
Well I originally learned because it is used in script builders and I wanted to make my own scripting command to go along with p299's admin (before kohl's existed) but today I have just came up with it's exactly the same as normal scripting, you just use it in scenarios that it would be impossible to use anything else.
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
10 Feb 2014 12:21 AM
ok, so where did you start learning..Like what sources?
Report Abuse
jakej78b is not online. jakej78b
Joined: 09 Mar 2011
Total Posts: 813
10 Feb 2014 12:24 AM
Lol sorry, it was hard for me to get this through my head too. Using loadstring is the exact same thing as typing script into your studio. It picks up where you left off. I never really learned it before now, I just thought it was something special and powerful function that would be fun to use.
Report Abuse
TheDominantLord is not online. TheDominantLord
Joined: 23 Aug 2011
Total Posts: 7866
10 Feb 2014 12:43 AM
jakey :D
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image