Plugins Run Scripts? HELP!

Hello DevForum,
I have had this thought for like a long time, and I need to upgrade my plugin, all it does is create the script and puts it into workspace, but right now I want it to run the script WITHOUT having to press play.

In other words, how do I make a plugin run a script without playing / running the game?

My Plugin:
image

1 Like

I think that’s imposibble, because the game hasnt launched and there’s no way to script to execute.

Instead of creating a script you could use loadstring and run the code from the plugin script.

1 Like

If LoadStringEnabled, a property of ServerScriptService is enabled, then you can just loadstring the code as @blokav said before me.

To give a small but practical example as to how loadstring works, you basically give it a string written out like code, and it returns a function

loadstring("print('hi')")

Just doing this isn’t enough since agian, it gives a function that must be called for it to run the code inside

loadstring("print('hi')")()

Result

image

Even though we didn’t sepcifcally write a print, since we gave a print statement in the loadstring, it still printed out something.

Basically do this, but with the code you want to run

2 Likes

I cant thank you guys enough, this is a great upgrade, VERSION–> v.35 now!

1 Like