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: Creating a script with a source

Previous Thread :: Next Thread 
Jakepoz is not online. Jakepoz
Joined: 16 Feb 2013
Total Posts: 83
21 Feb 2014 07:03 PM
Okay so I'm creating a script and I need it so if I say a certain command like l; (Lags a player)(Admin script) it will create a new localscript inside the players backpack. I can't put it anywhere in the game. I want it to be created from scratch from the main script itself Is that possible?
Report Abuse
7y13rb is not online. 7y13rb
Joined: 28 May 2011
Total Posts: 223
21 Feb 2014 07:04 PM
I've heard of it...i dont know how to do it though, but yeah i think its possible
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
21 Feb 2014 07:05 PM
No, that's not possible since the 'Source' property has been locked for quite a few years now.

The best you can do is have a pre-made LocalScript, and then clone it to the player. Also, I don't see why you want to lag-ban someone (if that's what you're going for), just use the ':Kick()' method on them.
Report Abuse
Delones is not online. Delones
Joined: 19 Jul 2010
Total Posts: 1703
21 Feb 2014 07:07 PM
No, but you could have a script with a stringvalue and use loadstring.
Report Abuse
Jakepoz is not online. Jakepoz
Joined: 16 Feb 2013
Total Posts: 83
21 Feb 2014 07:13 PM
@Data It is possible Optiplex123 Showed me a way that works in Script Builder
NewScript=Instance.new('LocalScript',v.Name)
NewScript.Source="while true do end"
This method creates the script with the correct source but does not run it... any help making it run?
Report Abuse
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
21 Feb 2014 07:15 PM
Simply use a premade localscript with a string value.

in the localscript, put

repeat wait(1/30) until script.StringValue.Value ~= "" --wait for the code to load

loadstring(script.StringValue.Value)

script:Destroy() --Optional, but helps to keep things clean.
Report Abuse
Jakepoz is not online. Jakepoz
Joined: 16 Feb 2013
Total Posts: 83
21 Feb 2014 07:17 PM
This works just doesnt run the script... And I don't want it to be premade I want as little lag as possible.


NewScript=Instance.new('LocalScript',game.Players.Jakepoz.Backpack) NewScript.Source="local n = Instance.new('Message',game.Workspace) n.Text='while true do end'"
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
21 Feb 2014 07:17 PM
@Jake,
That shouldn't (and wouldn't) work, at all, unless you're running it from the command bar or equivalent. The 'Source' property is locked.

It also wouldn't work, because you can't instance a script to a string.
Report Abuse
L0cky2013 is not online. L0cky2013
Joined: 30 Jul 2012
Total Posts: 1446
21 Feb 2014 07:18 PM
Its possible to do it in the command bar and in plugins.
Report Abuse
DataStore is not online. DataStore
Joined: 07 Feb 2012
Total Posts: 8540
21 Feb 2014 07:19 PM
Also, my reply was in reply to this line (second part)

"NewScript=Instance.new('LocalScript',v.Name)"
Report Abuse
theroadrunner is not online. theroadrunner
Joined: 06 Oct 2010
Total Posts: 862
21 Feb 2014 07:20 PM
A premade localscript which you can clone into playerGUIs is not laggy at all, not much anyways.

It's the simplest working method.
Report Abuse
Jakepoz is not online. Jakepoz
Joined: 16 Feb 2013
Total Posts: 83
21 Feb 2014 07:22 PM
I'm testing it online as soon as ROBLOX updates
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