SHOW:
|
|
- or go back to the newest paste.
| 1 | - | #FFA600K#5D5D5Dreatif~ |
| 1 | + | local marker = {
|
| 2 | [1] = "1963,1071,21", | |
| 3 | [2] = "1970,1020,21", | |
| 4 | [3] = "1912,1067,21", | |
| 5 | [4] = "1922,1014,21" | |
| 6 | } | |
| 7 | ||
| 8 | function change(Element) | |
| 9 | ||
| 10 | if getElementType(Element) ~= 'vehicle' then return end | |
| 11 | ||
| 12 | local rand = math.random(400,600) | |
| 13 | ||
| 14 | setElementModel(Element, rand) | |
| 15 | ||
| 16 | destroyElement(source) | |
| 17 | ||
| 18 | newMark() | |
| 19 | ||
| 20 | end | |
| 21 | ||
| 22 | function newMark() | |
| 23 | ||
| 24 | local rand = math.random(1,#marker) | |
| 25 | local x, y, z = gettok(marker[rand], 1, ","), gettok(marker[rand], 2, ","), gettok(marker[rand], 3, ",") | |
| 26 | markerx = createMarker(x,y,z,'checkpoint',5,125,125,0) | |
| 27 | ||
| 28 | addEventHandler('onMarkerHit', markerx, change)
| |
| 29 | ||
| 30 | end | |
| 31 | ||
| 32 | addEventHandler('onResourceStart', getRootElement(), newMark) |