ghettobird
LUA newbie
Hello OTland, today as the title says I will be introducing my latest script & explaining how helpful it might be...
Alright so imagine you are in a war and you find someone lower than level 100 (so you can't attack him) and he is mwalling all over the place, or even blocking your way so others can SD you and you can't do anything but heal... Quite frustrating ain't it?
So I came up with this talkaction so you can tp that player to temple BUT you need to be more than level 100 (obviously...) and he has to be lower than level 100 AND has to be in a NON PZ zone, that was he may be blocking you
So first go to talkactions/scripts & add this
Now go to talkactions.xml and add this
Your done Rep me?
Alright so imagine you are in a war and you find someone lower than level 100 (so you can't attack him) and he is mwalling all over the place, or even blocking your way so others can SD you and you can't do anything but heal... Quite frustrating ain't it?
So I came up with this talkaction so you can tp that player to temple BUT you need to be more than level 100 (obviously...) and he has to be lower than level 100 AND has to be in a NON PZ zone, that was he may be blocking you
So first go to talkactions/scripts & add this
Code:
local config = {
exhaustionInSeconds = 400,
storage = 36532
}
function onSay(cid, words, param)
local player = getPlayerByName(param)
if(param == '') then
doPlayerSendTextMessage(cid, 22, "Command requires param.")
return true
end
if(isPlayer(player) == FALSE) then
doPlayerSendTextMessage(cid, 22, "This players is offline, or doesnt exist.")
return TRUE
end
if(getPlayerLevel(player) >= 100) then
doPlayerSendTextMessage(cid, 22, "That guy's level is more than 100 -.-'")
return TRUE
end
if(getPlayerLevel(cid) < 100) then
doPlayerSendTextMessage(cid, 22, "Your not even level 100... Go hide in temple")
return TRUE
end
if(getPlayerSoul(cid) < 40) then
doPlayerSendTextMessage(cid, 22, "You need 40 soul points to teleport people.")
return TRUE
end
local pos = getPlayerPosition(player)
if(getTilePzInfo(pos) == TRUE) then
doPlayerSendTextMessage(cid, 22, "You can't teleport this player because he is in PZ zone.")
return TRUE
end
if(exhaustion.check(cid, config.storage) == TRUE) then
doPlayerSendTextMessage(cid, 22, "You can teleport players only one time per " .. config.exhaustionInSeconds .. " seconds.")
return TRUE
end
if(isPlayer(player) == TRUE) then
exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doTeleportThing(player, getTownTemplePosition(getPlayerTown(player)))
doPlayerSendTextMessage(player, 22, 'You have been teleported to temple by '.. getPlayerName(cid) ..'.')
doPlayerSendTextMessage(cid, 22, 'You succesfully teleported '.. getPlayerName(player) ..' to temple.')
doPlayerAddSoul(cid, -100)
return TRUE
end
return TRUE
end
Now go to talkactions.xml and add this
Code:
<talkaction log="no" words="!tp" access="0" event="script" value="tpnoobs.lua"/>
Your done Rep me?