Chaos Posted April 16, 2016 Share Posted April 16, 2016 Hi, i got stuck on script. I'm trying to make a command out put position as sequentially so when first time i do /count should out put the first position which is -2390,-2199,33,296 and when i do it again should out put second one and continue as like that, any idea ? warpPoses = { {-2390,-2199,33,296}, {-2389,-2200,33,296}, {-2389,-2202,33,296}, {-2388,-2203,33,296}, {-2387,-2205,33,296}, {-2386,-2206,33,296}, {-2390,-2207,33,296}, {-2391,-2206,33,296}, {-2392,-2204,33,296}, {-2393,-2203,33,296}, {-2393,-2201,33,296}, {-2395,-2199,33,296}, {-2397,-2202,33,296}, {-2396,-2204,33,296}, {-2395,-2206,33,296}, {-2394,-2207,33,296}, {-2393,-2209,33,296}, {-2397,-2209,33,296}, {-2399,-2207,33,296}, {-2400,-2204,33,296} } function table.len ( tb ) local c = 0 for i, v in pairs ( tb ) do c = c + 1 end return c end function test() local x, y, z, r = unpack ( warpPoses [ ( table.len ( warpPoses ) ) ] ) outputChatBox(x..","..y..","..z..","..r,root) end addCommandHandler("count",test) Link to comment
Simple0x47 Posted April 16, 2016 Share Posted April 16, 2016 Example. addCommandHandler("count", function () if not count or count >= #warpPoses then local count = 0 end local count = count + 1 print(unpack(warpPoses[count])) 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