1
2
3
2
3
usgn = 14706 boo = usgn.."hahaha" print(string.sub(boo,1,5))
How can i make it to prints 14706 but also could make it prints usgns that has smaller than 5 digits like 1234, 123,12,1
Scripts
Some string.sub questions
Some string.sub questions
1

usgn = 14706 boo = usgn.."hahaha" print(string.sub(boo,1,5))
print(string.sub(boo, 1, #tostring(usgn)))
string.sub(boo, 1, math.log(usgn,10)) -- the second parameter is automatically math.floor()ed
string.sub(boo, 1, #tostring(usgn))
addhook("say","on_say")
function on_say(p,txt)
	local usgn = player(p,"usgn")
	if txt=="!usgn" then
		msg2(p,"©255255000My USGN ID is "..usgn)
	elseif usgn==0 then -- If it's a guest player with no USGN ID it will not be displayed.
		return 1
	end
end

1
