CharacterRemoving page uses incorrect concatenation


#1

The first code example on the CharacterRemoving documentation page shows something being concatenated but it’s using incorrect concatenation for Lua.

print(player.Name + " spawned!")

Will error because it using a “+” instead of “..”; this line should be

print(player.Name .. " spawned!")


#2

Web devs forgot this ain’t js

Still would be cool if we had the plus operator for string concatenation


#3

EDIT: nevermind you can do this with regular lua but not rbxlua

getmetatable("").__add = function(a,b)
	return a..b
end

-> print("a" + "b")
<- ab

 -- can do it with other operators as well!
getmetatable("").__mod = function(a,b)
	return a..b
end

-> print("a" % "b")
<- ab