How would I make a script and then put a script in it? Like create a script, and then put a remote event function into it?
Are you asking how remote events work and how they function, or how to insert another script inside a script and insert a remote event at the same time?
If you wanna know how remote events work read the wiki
If you’re asking how to insert a script into a script you press the plus sign in explorer next to the script and insert it like that. Or right click and scroll down to insert object.
I want to know how to make a script from a script, and set its content from another script.
You can’t really do that with script but you can do it with the command bar in Studio. You can also do that with plugins I believe.
You can do Instance.new(‘Script’) and write into the script, but you’d be unable to write into it from the script.
You could use loadstring() but I’m not familiar with that and you’d have to figure that out on your own. I think it’s deprecated
Edit: I confused loadstring() with LoadString() sorry bout that. But I don’t recommend using it.
I think you’re talking about setting its actual source code. To set a script’s source, you must have a plugin script. Normal scripts and local scripts cannot use this feature, however, plugins can.
It’s as simple as:
local scr = Instance.new("Script")
scr.Name = "NewScript"
scr.Source = [[
local this = "Hello, world!"
print(this)
]]
scr.Parent = game.SeverScriptService
What’s the plugin?
(Necro bump; yeah)
No like, the code only works in plugin code and the command bar. You can create a plugin and add that code inside and it should work. There’s no specific plugin that only does this.