Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make a chat-scripting script?

Recently, Kohl's admin commands' :s (scripting) command stopped working, meaning that I can no longer script from the chat, which was really nice. So, I'm trying to make a script of my own that will enable me to script from the chat.

I discovered that loadstring() can be used to run strings as scripts. I tried that, and nothing happened. Here's the code I've tried:

game.Players.PlayerAdded:connect(function(player)
	player.Chatted:connect(function(msg)
		print("chatted")
		if string.sub(msg, 1, 2) == "s " then
			print("o:")
			pcall(function()
				loadstring(string.sub(msg, 3,string.len(msg)))()		
			end)
		end
	end)
	
end)

The script, in a nutshell, is supposed to check if the player put "s" in front of their message, signifying that it should be run as a script. Then, it should take the message after that and run it as a script.

Whenever I test the thing out, by chatting "s game.Workspace.Minifig77.Parent = game" it prints "chatted" and "o:", meaning that it detected that I want to script it. But, nothing happens. Why is this script not working?

1 answer

You probably just forgot to turn on your LoadStringEnabled which is a property of workspace.

This discussion is preserved as it was. New answers, comments, and votes are closed.