• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Edit Script

xLosT

Member
Joined
Jan 11, 2010
Messages
1,021
Reaction score
13
Location
Brasil, Rio Grande do Sul
this script makes a random position when login
but I want this to happen only if the player is with town_id 5


PHP:
local config = {
	pos = {
		{ x = 1000, y = 1002, z = 7 },
		{ x = 1002, y = 1001, z = 7 },
		{ x = 1005, y = 1001, z = 7 }
	},
	min = 8
}
function onLogin(cid)
	if(getPlayerLevel(cid) > config.min) then
		doTeleportThing(cid, config.pos[math.random(#config.pos)])
	end
	return TRUE
end
 
LUA:
local config = { 
    pos = { 
        { x = 1000, y = 1002, z = 7 }, 
        { x = 1002, y = 1001, z = 7 }, 
        { x = 1005, y = 1001, z = 7 } 
    }, 
    min = 8 
} 
function onLogin(cid) 
    if getPlayerTown(cid) ~= 5  then return true end
    if getDistanceBetween(getThingPos(cid), getTownTemplePosition(5)) > 8 then return true end
    if(getPlayerLevel(cid) > config.min) then 
        doTeleportThing(cid, config.pos[math.random(#config.pos)]) 
    end 
    return TRUE 
end
 
Last edited:
Back
Top