Hallo leute da ich den ganzen tag schon scripte und ich echt keinen klaren kopf habe wollte ich fragen wie ich am besten abfragen kann ob keins der math.random auf das math.random stimmt da ich dann das ganze wiederholen möchte bis es geht aber ich weiß nicht wie ich das am besten machen kann mein code.
Lua
local randomMap = {}
cMaploader["Mapcycle"] = function( ) -- // Automatic Mapchanger
local getMaps = cMaploader["getMaps"]()
local rnd = math.random( 0, #getMaps )
for v, m in pairs( getMaps ) do
local XML = xmlLoadFile(":"..getResourceName( m ).."/settings.xml")
if XML then
randomMap[m] = math.random( 0, #getMaps )
if randomMap[m] == rnd then
cMaploader["startMap"]( getResourceName(m) )
end
end
end
end
setTimer( cMaploader["Mapcycle"], getRealTime().second+1000, 0)
cMaploader["getMaps"] = function() -- // Ask all Maps
local resourceList = getResources()
local mapList = {}
for i,theResource in pairs(resourceList) do
if cMaploader["isMap"](theResource) then
table.insert(mapList, theResource)
end
end
return mapList
end
Alles anzeigen