To be honest this is starting to get to me.. lol
I don't need my question getting deleted so i'll write a code attempt if anyone could answer this question it would help alot
1 | Instance.new( "Script" ,game.Workspace).Source = "print(\"Hello World! v2\")" |
note this isn't mine this is a script i found when trying to figure this question out
Sources cannot be set with a script, however, you can with command bar or studio property panel. What I am assuming what you want done, is to run a custom string in Lua. For that, we will need loadstring. For example, you could make a remote event and a client fires it.
1 | game.ReplicatedStorage:WaitForChild( 'SentCode' --[[or the remote name]] ).OnServerEvent:Connect( function (plr, code) |
2 | pcall ( function () |
3 | loadstring (code)() --MAKE SURE YOU DON'T FORGET THE TWO PARENTHESIS AT THE END, I DO NOT KNOW WHY YOU NEED THEM BUT WITHOUT THEM THE CODE DOES NOT RUN. |
4 | end ) |
5 | end ) |
If you are trying to do something else, please put a comment and tell me what u want to happen.