All i want to do is a dev console. Here's the script and error:
Script:
script.Parent.TextButton.MouseButton1Click:Connect(function(player) local CurrentScript = false CurrentScript = script.Parent.TextBox.Text CurrentScript() end)
Error:
attempt to call local 'CurrentScript' (a string value)
Well every time i try to use the console, it gives me an error. How can i turn the code i put in the textbox into a script instead of string?
CurrentScript is not a function, rather a string. But you can use loadstring to execute Lua code as a string.
It returns a function that you call:
-- in a server script loadstring("print(1)")()
loadstring can only be called on the server and there's already a dev console, why reinvent the wheel?