nefinoo
Carnage.flv
I am using otservbr global
local talk = TalkAction("!home")
function talk.onSay(player, words, param)
local house = player:getHouse()
if not house then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You do not have a house.")
return false
end
if player:isPzLocked() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You cannot teleport yourself or other while in combat.")
return false
end
if player:getSkull() ~= SKULL_NONE then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You can't teleport yourself or players with a skull.")
return false
end
player:teleportTo(house:getExitPosition())
return...
local talk = TalkAction("!home")
function talk.onSay(player, words, param)
player:teleportTo(player:getTown():getTemplePosition())
return false
end
talk:separator(" ")
talk:register()
local talk = TalkAction("!home")
function talk.onSay(player, words, param)
local house = player:getHouse()
if not house then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You do not have a house.")
return false
end
if player:isPzLocked() then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You cannot teleport yourself or other while in combat.")
return false
end
if player:getSkull() ~= SKULL_NONE then
player:sendTextMessage(MESSAGE_STATUS_SMALL, "You can't teleport yourself or players with a skull.")
return false
end
player:teleportTo(house:getExitPosition())
return false
end
talk:separator(" ")
talk:register()
You are checking if house exists twice. First check is enough, it wont proceed.So the final script will look like this one, Just added few checks to Znote's one.
Lua:local talk = TalkAction("!home") function talk.onSay(player, words, param) local house = player:getHouse() if not house then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You do not have a house.") return false end if config.pzlocked and player:isPzLocked() then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You cannot teleport yourself or other while in combat.") return false end if player:getSkull() ~= SKULL_NONE then player:sendTextMessage(MESSAGE_STATUS_SMALL, "You can't teleport yourself or players with a skull.") return false end if house then player:teleportTo(house:getExitPosition()) end return false end talk:separator(" ") talk:register()
you deleted the wrong check, you should have deleted the last oneThanks, Edited it, I just coped the checks from different script quickly as I was going off.
if house then
, because if player has no house then there is no point to proceed even further.