• 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!

request for 2 scripts

arheon

Own3d PlAx.'?
Joined
Aug 31, 2009
Messages
92
Reaction score
3
Hey guys i need 2 war scripts for my ot.
The first one will make that if you live in carlin *town_id 1*
you will get a blue outfit after you log-in, and if you live in thais *town_id 2* you will get red outfit after you log-in.

The second one is that if someone has same colors you cannot atk him , or if he is from same town.
I really need they , if someone could help me , beacuse i failed xD
 
Lua:
local redOutfit_male = {
lookType = math.random(128,134),
lookHead = 94,
lookBody = 94,
lookLegs = 94,
lookFeet = 94,
lookTypeEx = 0,
lookAddons = 3
}

local redOutfit_female = {
lookType = math.random(136,142),
lookHead = 94,
lookBody = 94,
lookLegs = 94,
lookFeet = 94,
lookTypeEx = 0,
lookAddons = 3
}

local blueOutfit_male = {
lookType = math.random(128,134),
lookHead = 88,
lookBody = 88,
lookLegs = 88,
lookFeet = 88,
lookTypeEx = 0,
lookAddons = 3
}

local blueOutfit_female = {
lookType = math.random(136,142),
lookHead = 88,
lookBody = 88,
lookLegs = 88,
lookFeet = 88,
lookTypeEx = 0,
lookAddons = 3
}

function onLogin(cid)
        if getPlayerTownId == 1 then
                if getPlayerSex(cid) == 1 then
                        doCreatureChangeOutfit(cid, redOutfit_male)
                elseif getPlayerSex(cid) ~= 1 then
                        doCreatureChangeOutfit(cid, redOutfit_female)
                end
        elseif getPlayerTownId == 2
                if getPlayerSex(cid) == 1 then
                        doCreatureChangeOutfit(cid, blueOutfit_male)
                elseif getPlayerSex(cid) ~= 1 then
                        doCreatureChangeOutfit(cid, blueOutfit_female)
                end
    return TRUE
end

and in config.lua do this

Lua:
noDamageToSameLookfeet = "yes"

Have not tested, should work

+rep?
 
im going to test it right now
@edit
it debugged a server when i logged
im going to work a bit with script and look if i can repair it somehow
anyway ty for help and ofc rep+ ;*

and u didnt write one 'then' in 48 line : D


FIXED The problem was i use newest tfs and in newest tfs there's no getPlayerTownId but getPlayerTown(cid)
Here is working script if someone except me will need it :
local redOutfit_male = {
lookType = math.random(128,134),
lookHead = 94,
lookBody = 94,
lookLegs = 94,
lookFeet = 94,
lookTypeEx = 0,
lookAddons = 3
}

local redOutfit_female = {
lookType = math.random(136,142),
lookHead = 94,
lookBody = 94,
lookLegs = 94,
lookFeet = 94,
lookTypeEx = 0,
lookAddons = 3
}

local blueOutfit_male = {
lookType = math.random(128,134),
lookHead = 88,
lookBody = 88,
lookLegs = 88,
lookFeet = 88,
lookTypeEx = 0,
lookAddons = 3
}

local blueOutfit_female = {
lookType = math.random(136,142),
lookHead = 88,
lookBody = 88,
lookLegs = 88,
lookFeet = 88,
lookTypeEx = 0,
lookAddons = 3
}

function onLogin(cid)
if getPlayerTown(cid) == 1 then
if getPlayerSex(cid) == 1 then
doCreatureChangeOutfit(cid, redOutfit_male)
elseif getPlayerSex(cid) ~= 1 then
doCreatureChangeOutfit(cid, redOutfit_female)
end
elseif getPlayerTown(cid) == 2 then
if getPlayerSex(cid) == 1 then
doCreatureChangeOutfit(cid, blueOutfit_male)
elseif getPlayerSex(cid) ~= 1 then
doCreatureChangeOutfit(cid, blueOutfit_female)
end
return TRUE
end
Again thnx to unknown ; D
 
Last edited:
Back
Top