English Lua "Q" : the string.sub

2 replies
Goto Page
To the start Previous 1 Next To the start
14.02.18 09:40:26 pm
Up
script favor
User
Offline Off
Hello ,

I want to ask do the string.sub has mathematical behavior ?
e.g :
Code:
1
2
3
if string.sub(1,8+2-5)=="!kick" then

     etc.....


Actually didn't knew that.
Visit my website : https://bounty-mafia.tk , Discord : https://discord.gg/ntNd6TX, IMG:http://i60.tinypic.com/5kixc8.gif
14.02.18 11:02:59 pm
Up
DC
Admin
Offline Off
This is not related to that specific command at all. It's a general programming/scripting thing. You can do it everywhere.
Any parameter / value can either be a fixed value, a variable, a function call or a mathematical/logical expression (which can also contain other variables and function calls).
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
15.02.18 10:48:39 am
Up
Avo
User
Offline Off
What user DC said. You can easily do stuff like that:
Code:
1
2
if string.sub(aString, 1, string.len(aString) - 1)=="!kick" then
 (...)
To the start Previous 1 Next To the start