Roblox lua match. The stringgmatch function will take an input string and a pattern. Its default value is 1 and can be negative. Local vec3 vector3new0 10 5 local magnitude vec3magnitude.
While that is true a lot of users just use lua for roblox and nothing else and as a result they dont really know what the differences are between roblox lua and regular lua. Projectmatrixzergo apr 9th 2019 8728 never not a member of pastebin yet. Roblox lua vs regular lua.
Raw download clone embed report print lua 9800 kb local green red color3. Sign up it unlocks many cool features. View mobile site jokeypsych endgamehonest galaxyquest.
Its more limited and has different syntax. By continuing to use pastebin you agree to our use of cookies as described in the cookies policy. Fromrgb 0 240 0 color3.
If youre used to other languages that have regular expressions to match text remember that luas pattern matching is not the same. Direct matches can be done for any non magic characters by simply using them literally in a lua function like stringmatch. In vector theory magnitude is the length of a vector.
If a match is found it is returned. Magnitude is a mathematical term which can mean several things. Roblox has a special property for datatypevector3vector3 and datatypevector2vector2 values that finds the magnitude for you accessible as follows.
Otherwise it returns nil. Code sample expected output expand. The truth many users claim that roblox lua is different than regular lua.
Fromrgb 240 0 0. Lua patterns can match sequences of characters where each character can be optional or repeat multiple times. A third optional numerical argument init specifies where to start the search.
This pattern describes on what to actually get back. Example how it works. For example these commands look for the word roblox within a string.