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

Who can fix this script! simple script! Rep++ Tfs 0.3.6

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
Fix it to Tfs 0.3.6

Code:
-- Script made by Huggen --
-- Config --
voc = 5 -- The new vocation.
townid = 2 -- The new townid.
-- /Config --
function onStepIn(cid, item, position, fromPosition)
doPlayerSetTown(cid, townid)
doPlayerSetVocation(cid,voc)
end
 
if you are using itemid 1387 ( teleport field)

Go to citizen.lua and replace it with this:
LUA:
function onStepIn(cid, item, position, fromPosition)
	if(item.actionid > 30020 and item.actionid < 30100) then
		local townId = (item.actionid - 30020)
		doPlayerSetTown(cid, townId)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You are the newest resident of " .. getTownName(townId) .. ".")
	end

	return true
end

local config = {
				voc = 5,
				townid = 2
				};
				
function onStepIn(cid, item, position, fromPosition)
		if(item.actionid > 50000 and item.actionid < 50100) then
				doPlayerSetTown(cid, (config.townid))
				doPlayerSetVocation(cid, (config.voc))
		end
		return TRUE
end

use an actionid between 50.000 and 51.000
 
Fix it to Tfs 0.3.6

Code:
-- Script made by Huggen --
-- Config --
voc = 5 -- The new vocation.
townid = 2 -- The new townid.
-- /Config --
function onStepIn(cid, item, position, fromPosition)
doPlayerSetTown(cid, townid)
doPlayerSetVocation(cid,voc)
end

Errrmmm... Im new but... i think
Code:
doPlayerSetVocation(cid,voc)
shall looks like this
doPlayerSetVocation(cid, voc)

If it's still dodn't work, please - give us console error ;)
 
Code:
-- Script made by Huggen --
-- Config --
voc = 5 -- The new vocation.
townid = 2 -- The new townid.
-- /Config --
function onStepIn(cid, item, position, fromPosition)
doPlayerSetTown(cid, townid)
doPlayerSetVocation(cid,voc)
end
return TRUE
end
 
LUA:
local voc = 5 -- The new vocation
local townid = 2 -- The new townid
function onStepIn(cid, item, position, fromPosition)
doPlayerSetTown(cid, townid)
doPlayerSetVocation(cid,voc)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "your vocation hav ebeen changed")
end
return TRUE
end

then go to movement .xml and add on step in and out events and it should work
 
@up won't work

Code:
local voc = 5

function onStepIn(cid, item, position, fromPosition)
doPlayerSetTown(cid,2)
doPlayerSetVocation(cid,voc)
end

This shouldn't work if yours didn't.. ;s

what server version?
 
Back
Top