Attempt to call a string value



Trying to make code run on a command line called TextBox but it isn’t working please help due an error called “Attempt to call a string value”

image
Image of error.

in the Server script on line 10 you used tostring on the LoadString function which makes a string
so when Connecting the RemoteEvent you are calling a string
Instead it should be

RemoteEvent.OnServerEvent:Connect(LoadString)
1 Like

Did that still reproduced that same error.

I tried it out and it worked for me. are you sure you’ve done it correctly?

What text were you putting into the input box?
Also, if you enable the output in studio (somewhere in view there is the option to enable it), it should show the line teh error occurs on

Basic like changing the transperency of the baseplate.

In the server script, can you please print out the variables Input and String? (I know that they should theoretically be the same, but gotta make sure). When testing, please put in the textbox an actual command, even if it is just print("Hello World")

  1. You should properly call the function
RemoteEvent.OnServerEvent:Connect(LoadString)
  1. You don’t need to use tostring because you are already passing the parameter as a string (but it’s not critical, you can not remove it)
  2. Try not loadstring(Input), but loadstring(Input)()
  3. I HIGHLY RECOMMEND DO NOT MAKE THIS CODE, because exploiters will be able to run any code on your server with an event (Of course if that’s not your task)
1 Like