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

Print() function isn't working?

Okay to sum up my problem I'm making a fully operational AI on roblox to help out on studio when you have questions and stuff but for some reason it's not working

bosswalrus

game.Players.PlayerAdded:connect(function(player)
	player.Chatted:connect(function(msg, player)
	if msg:lower():sub(1,10) == "bosswalrus" then
		returnmsg = ''
		am = msg:sub(12):lower()
		if am == "hello" then 
			print["Hello]"
		end
	end)
end)

2 answers

✓ Accepted answer

print["Hello]" should probably be print"[Hello]"

2 comments

0

Thanks it worked, I don't know what was wrong but it worekd perfectly

1

With a square bracket, the script is expecting something else, not a string which will be printed.

game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(msg, player)
    if msg:lower():sub(1,10) == "bosswalrus" then
        returnmsg = ''
        am = msg:sub(12):lower()
        if am == "hello" then 
            print("Hello")
        end
    end)
end)

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