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

what is wrong in this script?

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Reaction score
3
its firstitems.lua by me, i've tried to make other items for other vocations, it doesn't give errors but doesnt work...

i am using TFS 0.3.4pl2 (using Gesior ACC but when i create character it doesnt look for items from samples what makes char is empty)..
Code:
local playerVoc = getPlayerVocation(cid)

function onLogin(cid)
	if getPlayerStorageValue(cid, 30001) <= 0 then
		if playerVoc == 1 or playerVoc == 5 then --If Vocation is Sorcerer or Master Sorcerer
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2190, 1) --wand of vortex
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpacksorek = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpacksorek, 2554, 1) --shovel
			doAddContainerItem(backpacksorek, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)

		elseif playerVoc == 2 or playerVoc == 6 then --If Voc == Druid or Elder Druid
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2182, 1) --snakebite rod
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpackdruid = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpackdruid, 2554, 1) --shovel
			doAddContainerItem(backpackdruid, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)

		elseif playerVoc == 3 or playerVoc == 7 then --If Voc == Paladin or Royal Paladin
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2389, 1) --spear
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpackdruid = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpackdruid, 2554, 1) --shovel
			doAddContainerItem(backpackdruid, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)

		elseif playerVoc == 4 or playerVoc == 8 then --If Voc == Knight or Elite Knight
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2482, 1) --orcish axe
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpackdruid = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpackdruid, 2554, 1) --shovel
			doAddContainerItem(backpackdruid, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)
		end
	end

 	return TRUE
end
 
Code:
function onLogin(cid)
local playerVoc = getPlayerVocation(cid)

	if getPlayerStorageValue(cid, 30001) <= 0 then
		if playerVoc == 1 or playerVoc == 5 then --If Vocation is Sorcerer or Master Sorcerer
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2190, 1) --wand of vortex
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpacksorek = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpacksorek, 2554, 1) --shovel
			doAddContainerItem(backpacksorek, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)

		elseif playerVoc == 2 or playerVoc == 6 then --If Voc == Druid or Elder Druid
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2182, 1) --snakebite rod
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpackdruid = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpackdruid, 2554, 1) --shovel
			doAddContainerItem(backpackdruid, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)

		elseif playerVoc == 3 or playerVoc == 7 then --If Voc == Paladin or Royal Paladin
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2389, 1) --spear
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpackdruid = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpackdruid, 2554, 1) --shovel
			doAddContainerItem(backpackdruid, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)

		elseif playerVoc == 4 or playerVoc == 8 then --If Voc == Knight or Elite Knight
			doPlayerAddItem(cid, 2457, 1) --steel helmet
			doPlayerAddItem(cid, 2463, 1) --plate armor
			doPlayerAddItem(cid, 2482, 1) --orcish axe
			doPlayerAddItem(cid, 2525, 1) --dwarven shield
			doPlayerAddItem(cid, 2647, 1) --plate legs
			doPlayerAddItem(cid, 2643, 1) --leather boots
			doPlayerAddItem(cid, 2120, 1) --rope
			local backpackdruid = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(backpackdruid, 2554, 1) --shovel
			doAddContainerItem(backpackdruid, 2152, 2) --2 platinum coins
			setPlayerStorageValue(cid, 30001, 1)
		end
	end

 	return TRUE
end

Try that
 
Back
Top