Soldier666 Posted April 15, 2013 Share Posted April 15, 2013 Hello everyone , I need someone to explain me how to correctly use if math.random Please someone just build me a base structure of this Link to comment
Castillo Posted April 15, 2013 Share Posted April 15, 2013 http://lua-users.org/wiki/MathLibraryTutorial http://pgl.yoyo.org/luai/i/math.random Link to comment
Soldier666 Posted April 16, 2013 Author Share Posted April 16, 2013 (edited) Okay but how does it work? EDIT:Sorry for DB, smth messed up Edited April 16, 2013 by Guest Link to comment
Soldier666 Posted April 16, 2013 Author Share Posted April 16, 2013 Okay but how does it work? if math.random( 1, 2 ) == 1 then here goest the script AND how to call IF NOT 1? smth like if math.random( 1, 2 ) == 1 then here goest the script else the action if it's not 1.. But I've tried it and it doesnt work properly.. maybe because my if math.random is already in another IF ..? Link to comment
iPrestege Posted April 16, 2013 Share Posted April 16, 2013 addCommandHandler("Text", function ( ) local Text = math.random(1,2) if ( Text == 1 ) then return outputChatBox("* Text Found!") end -- if found the text then return to ... outputChatBox(tostring(Text)) -- output the other text (2) end ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now