sorry, but what do you mean by "also when the resource starts, loop players and create them as well.", i dont understand, can you please teach me?
Here is what I have so far, haven't tested it though.
c_root = getRootElement()
function createZone ()
playerZone = createColTube ( 0, 0, 0, 10.0, 100.0 )
attachElements ( playerZone, c_root, 0, 0, 0 )
outputChatBox ( "created", source )
end
addEventHandler ( "onPlayerJoin", c_root, createZone )
addEventHandler ( "onResourceStart", c_root, createZone )
function zoneEnter ()
outputChatBox("A Player is in Your Zone!", c_root)
end
addEventHandler ( "onColShapeHit", playerZone, zoneEnter )
function giveMoney()
for index, player in ipairs ( getElementsWithinColShape ( playerZone, "player" ) ) do
givePlayerMoney( player, 5000 )
end
end
addEventHandler ("onPlayerWasted", c_root, giveMoney )