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

Lua Problems with my script

RaikND

facebook.xenoria.org
Joined
May 12, 2010
Messages
942
Reaction score
10
Location
Spain
I dont know error, not show anything on console :S

Movements:
Lua:
local cfg = {
      level = 8,  
      storage = 65502,
	  open = {"2", "open", "openpvp"},
	  tpActive = {x=1354, y=1045, z=6},
	  tpCancel = {x=1354, y=1048, z=6},
      textActive = 'Your PVP now are Actived.',
      cancelText = 'You PVP is already active.'
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if not isPlayer(cid) then
        return true
    end
 
    if getCreatureStorage(cid, cfg.storage) > -1 then
        doPlayerSendCancel(cid, cfg.cancelText)
        return true
    end
 
    if getPlayerLevel(cid) < cfg.level then
        doPlayerSendCancel(cid, 'Your need level ['..cfg.level..'], for getout from city')
        return true
    end
 
    if item.actionid == cfg.storage then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, cfg.textActive)
		doTeleportThing(cid, cfg.tpCancel, 0)
        doCreatureSetStorage(cid, cfg.storage, 1)
    end
	
	local world = getWorldType()
	if(table.isStrIn(param, cfg.open)) and isPlayer(cid) then
		setWorldType(WORLDTYPE_OPEN)
		doTeleportThing(cid, cfg.tpActive, 0)
		world = "Open PvP"
	end
    return true
end

Please help!
 
Last edited:
Lua:
local cfg = {
	level = 8,  
	storage = 65502,
	worldType = 2, -- 1 -> OptionalPvP, 2 -> OpenPVP, 3 -> HardcorePvP.
	tpPos = {x=1354, y=1045, z=6},
	textActive = 'Your PVP now are Actived.',
	cancelText = 'You PVP is already active.'
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if not isPlayer(cid) then
		return
	elseif getCreatureStorage(cid, cfg.storage) == 1 then
		return doPlayerSendCancel(cid, cfg.cancelText)
	elseif getPlayerLevel(cid) < cfg.level then
		return doPlayerSendCancel(cid, 'Your need level ['..cfg.level..'] to get out of the city.')
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, cfg.textActive)
		doTeleportThing(cid, cfg.tpPos)
		setWorldType(cfg.worldType)
		doCreatureSetStorage(cid, cfg.storage, 1)
		doBroadcastMessage("Gameworld type set to: " .. worldType .. ".", MESSAGE_EVENT_ADVANCE)
	end

	return true
end
 
Lua:
local cfg = {
	level = 8,  
	storage = 65502,
	worldType = 2, -- 1 -> OptionalPvP, 2 -> OpenPVP, 3 -> HardcorePvP.
	tpPos = {x=1354, y=1045, z=6},
	textActive = 'Your PVP now are Actived.',
	cancelText = 'You PVP is already active.'
}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if not isPlayer(cid) then
		return
	elseif getCreatureStorage(cid, cfg.storage) == 1 then
		return doPlayerSendCancel(cid, cfg.cancelText)
	elseif getPlayerLevel(cid) < cfg.level then
		return doPlayerSendCancel(cid, 'Your need level ['..cfg.level..'] to get out of the city.')
	else
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, cfg.textActive)
		doTeleportThing(cid, cfg.tpPos)
		setWorldType(cfg.worldType)
		doCreatureSetStorage(cid, cfg.storage, 1)
		doBroadcastMessage("Gameworld type set to: " .. worldType .. ".", MESSAGE_EVENT_ADVANCE)
	end

	return true
end

I reedit MAIN POST!
i want make a Player when exit from City NOPvP get PVP and after enter to the city put again on NoPvP, sorry for my english, its really bad :(
 
Last edited:
bump :( script from Cyko doesn't work!

New editing:
Lua:
local cfg = {
      level = 8,  
      actionID = 65502,
	  open = {"2", "open", "openpvp"},
	  tpActive = {x=1354, y=1048, z=6},
      textActive = 'Your PVP now are Actived.'
}
 
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    if not isPlayer(cid) then
        return true
    end
  
    if getPlayerLevel(cid) < cfg.level then
        doPlayerSendCancel(cid, 'Your need level ['..cfg.level..'], for getout from city')
        return true
    end
 
    if item.actionid == cfg.actionID then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, cfg.textActive)
		doTeleportThing(cid, cfg.tpActive)
		return true
    end
	
	param = param:lower()
	local world = getWorldType()
	if(table.isStrIn(param, cfg.open)) and isPlayer(cid) then
		setWorldType(WORLDTYPE_OPEN)
		world = "Open PvP"
	end
    return true
end

HOW I TURN PVP OFF???
 
Last edited:
Back
Top