Can a script run a command in the command bar?

I am trying to make an admin commands system for my game with a command bar that can run Lua commands thru the Roblox Studio command bar and I was wondering how I could do this. I have tried looking this up but I can’t seem to find any references to anything that could do this.

1 Like

Kinda. You can use loadstring to execute code. Loadstring returns a function which can be called as normal. It has to be turned on under ServerScriptService

local myFunc = 'print(hi)'

local func = loadstring(myFunc)
func() --> hi
1 Like