so @tut you closed and now i cant see these posts u closed how i ill solve my problem
ERROR: play\broph.lua:27: bad argument #2 to 'random' (interval is empty)
ERROR: play\broph.lua:27: bad argument #2 to 'random' (interval is empty)
i mean when someone try login this show in the server... i just look and some people not all try to login and some times quit the game but other players login normally...
local spawnpoint
addEventHandler("onResourceStart", resourceRoot,
function()
spawnpoint = getRandomSpawnPoint()
resetMapInfo()
for i,player in ipairs(getElementsByType("player")) do
spawn(player)
end
end
)
function spawn(player)
if not isElement(player) then return end
if get("spawnreset") == "onSpawn" then
spawnpoint = getRandomSpawnPoint()
end
exports.spawnmanager:spawnPlayerAtSpawnpoint(player,spawnpoint,false)
repeat until setElementModel(player,math.random(312))
fadeCamera(player, true)
setCameraTarget(player, player)
showChat(player, true)
end
function getRandomSpawnPoint ()
local spawnpoints = getElementsByType("spawnpoint")
return spawnpoints[math.random(1,#spawnpoints)]
end
addEventHandler("onPlayerJoin", root,
function()
spawn(source)
end
)
addEventHandler("onPlayerQuit",root,
function ()
if getPlayerCount() == 1 and get("spawnreset") == "onServerEmpty" then
spawnpoint = getRandomSpawnPoint()
end
end
)
addEventHandler("onPlayerWasted", root,
function()
setTimer(spawn, 1800, 1, source)
end
)
i really dont know coding, i just know edit. i tried to delete this line and i got a error in line 18... i dont know if you guys have a correct play archive or correct broph.lua