• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[8.54] helmet changing voc and looktype on equip and turn it off of dequip

iksior

New Member
Joined
Jan 25, 2009
Messages
33
Reaction score
0
Hello everybody ! It's me again. Well Today I want scipt that do somethink like that
onEquip it change your voc to 5 and change looktype to 144 lookhead 112 and so..
onDeEquip it change voc to that before Equip voc and looktype to that before Equip
 
Not tested:
Code:
	<movevent event="Equip" itemid="9999" function="onEquipItem" slot="helmet" script="file.lua"/>
	<movevent event="DeEquip" itemid="9999" function="onDeEquipItem" slot="helmet" script="file.lua"/>
file.lua
LUA:
local c = {
	outfit = {lookHead = 19, lookBody = 53, lookLegs = 92, lookFeet = 79, lookAddons = 0},
	male = 144,
	female = 148,
	storage = 32415,
	vocation = 5
}	
function onEquip(cid, item, slot)
	local x = 0
	if getPlayerSex(cid) == 1 then
		x = c.male
	else
		x = c.female
	end
	local outfit = createConditionObject(CONDITION_OUTFIT)
	setConditionParam(outfit, CONDITION_PARAM_TICKS, -1)
	addOutfitCondition(outfit, {lookType = x, lookHead = c.outfit[1], lookBody = c.outfit[2], lookLegs = c.outfit[3], lookFeet = c.outfit[4], lookAddons = c.outfit[5]})
	setPlayerStorageValue(cid, c.storage, getPlayerVocation(cid))
	doAddCondition(cid, outfit)
	doPlayerSetVocation(cid, c.vocation)
	return true
end
function onDeEquip(cid, item, slot)
	doPlayerSetVocation(cid, getPlayerStorageValue(cid, c.storage))
	setPlayerStorageValue(cid, c.storage, -1)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	return true
end
 
LUA:
local cfg = {
	male = {lookType = 144, lookHead = 19, lookBody = 53, lookLegs = 92, lookFeet = 79, lookAddons = 0},
	female = {lookType = 148, lookHead = 19, lookBody = 53, lookLegs = 92, lookFeet = 79, lookAddons = 0},
	vocation = 5,
	storage  = 9999
}

local male = createConditionObject(CONDITION_OUTFIT)
setConditionParam(male, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(male, cfg.male)

local female = createConditionObject(CONDITION_OUTFIT)
setConditionParam(female, CONDITION_PARAM_TICKS, -1)
addOutfitCondition(female, cfg.female)

function onEquip(cid, item, slot)
	doAddCondition(cid, getPlayerSex(cid) == 1 and male or female)
	setPlayerStorageValue(cid, cfg.storage, getPlayerVocation(cid))
	doPlayerSetVocation(cid, cfg.vocation)
	return TRUE
end

function onDeEquip(cid, item, slot)
	doPlayerSetVocation(cid, getPlayerStorageValue(cid, cfg.storage))
	setPlayerStorageValue(cid, cfg.storage, -1)
	doRemoveCondition(cid, CONDITION_OUTFIT)
	return TRUE
end
 
ok almost done but in Your script pepe it doesn't set back preverious vocation after deEquip and set my outfitt to citizen. In my cfg.lua i have option that didnt allow to change outfits. so it should change my outfit to preverious.
 
Back
Top