Please help me. I search it in google. and i found 2 ways.
1.Source
local script = Instance.new("Script",workspace) script.Source = 'print("Hello world!")'
But this isn't working anymore.
2.loadstring
local script = Instance.new("Script",workspace) --why did he Instance a script? ( EteraW ) code.Value = 'print("Hello world!")' loadstring(code.Value)()
This look like to work. But I don't know how to stop the script.
script:Destroy()
doesn't stop the script.
Please help. I'm confused now!
You cant write code to a script after creating it with a script, you COULD use a loadstring but personally I prefer having a disabled script somewhere, then moving it or cloning it somewhere and making the disabled property false. However if you really want to use loadstrings, make sure the property in ServerScriptService called loadstrings enabled is true, however beware this can be the target of exploiters