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

Requesting Revange System read please :P big rep++

izaak

New Member
Joined
Feb 1, 2009
Messages
161
Reaction score
3
i have an idea for a revange system , ive tryd to script it for days now but i fail.

the idea is this, if a player dies by another player he gets a storage value wich allows him and all his party members to teleport to the killer 1 time,when he says /revange player name or something

after the teleport to the killer the storage value should be deleted , its epic for rpg server..

if any1 likes it and decides to script it please share i really want it badly
i know its possible because this guy made a script that already teleports the party but then to urself
i want them to tp to the killer


this script made the idea of the revange system pop to my head xD
 
Last edited:
Code:
function onSay(cid, words, param, channel)
local player = getPlayerByNameWildcard(param)
if(not player) then return true
end
for _, party in ipairs(getPartyMembers(player)) do
if getPlayerStorageValue(cid, 9001) == 1 then
doTeleportThing(party, getCreaturePosition(cid))
doSendMagicEffect(getCreaturePosition(party), math.random(0, CONST_ME_LAST))
doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported by "..getCreatureName(cid)..".")
setPlayerStorageValue(cid, 9001, 0)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "no")
end
end
return true
end

That was not hard, do it yourself next time. Also this section is not for requests
 
iam a beginning scripter and ty imma test it if it works u get big rep++ like a 18+ repsystem xD
on what basis did u write this i mean how do i add it so i dont get an error

[17/09/2010 05:04:41] [Error - TalkAction Interface]
[17/09/2010 05:04:41] data/talkactions/scripts/revange.lua:onSay
[17/09/2010 05:04:41] Description:
[17/09/2010 05:04:41] data/talkactions/scripts/revange.lua:9: attempt to index global 'tile' (a nil value)
[17/09/2010 05:04:41] stack traceback:
[17/09/2010 05:04:41] data/talkactions/scripts/revange.lua:9: in function <data/talkactions/scripts/revange.lua:6>
 
Last edited:
So far its getting better i got

Code:
function onSay(cid, words, param, channel)
if param == "" or not revange then
		return doPlayerSendCancel(cid, "Command param required.")
	end
if getPlayerStorageValue(cid,8778,1) then
if (param) ~= string.lower(getCreatureName(cid)) then
for _, party in ipairs(getPartyMembers(player)) do
doTeleportThing(party, Creature_pos(cid))
doSendMagicEffect(getCreaturePosition(party), math.random(0, CONST_ME_LAST))
doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported To "..getCreatureName(cid)..".")
setPlayerStorageValue(cid, 8778,0)
end
else
if getPlayerStorageValue(cid,8778,0) then
doPlayerSendCancel(cid, "Sorry you cant teleport.")
return true
end
end
end
end

and in creaturescript i have
Code:
local config = {
        killStorageValue = 3943,
        deathStorageValue = 8778
		}
function onDeath(cid, corpse, killer)
        if(isPlayer(killer) == TRUE) then
                local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
                local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
 
                local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
                local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
 
                setPlayerStorageValue(killer, config.killStorageValue, targetKills)
                setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
 
                local killerLevel = getPlayerLevel(killer)
                local targetLevel = getPlayerLevel(cid)
                local levelDiff = targetLevel - killerLevel
 
                local values = {
                        ["KILLERKILLS"] = killerKills,
                        ["KILLERDEATHS"] = killerDeaths,
                        ["KILLERNAME"] = getCreatureName(killer),
                        ["KILLERLEVEL"] = killerLevel,
 
                        ["TARGETKILLS"] = targetKills,
                        ["TARGETDEATHS"] = targetDeaths,
                        ["TARGETNAME"] = getCreatureName(cid),
                        ["TARGETLEVEL"] = targetLevel
                }
                end
                if(config.killerAnimation.use) then
                        doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
                end
                if(config.targetAnimation.use) then
                        doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
                end
        end

and in login i got
Code:
registerCreatureEvent(cid, "Revange")
but still its not summoning its saying command param requerd
idk can any1 help me with this? :P
if 1 of u finds time to fix it i wil be verry gratefull and also wil rep u good..
 
to get to know more so when this player that died type revenge he and his party players are tped to killer or he and his party are allowed to be tped to the killer?
 
ýes i want that but non of thse scripts work

iwant the player that died to be able to tp to the killer 1 time
he has the power to tp there with everyone in his party for 1 time
 
Last edited:
That was not hard, do it yourself next time. Also this section is not for requests

WTF...The Requests section is not for requests. Clear as water!

@OP:
Code:
function onSay(cid, words, param, channel)
if param == "" or not revange then
		return doPlayerSendCancel(cid, "Command param required.")
	end
if getPlayerStorageValue(cid,8778,1) then
if (param) ~= string.lower(getCreatureName(cid)) then
for _, party in ipairs(getPartyMembers(player)) do
doTeleportThing(party, Creature_pos(cid))
doSendMagicEffect(getCreaturePosition(party), math.random(0, CONST_ME_LAST))
[B]doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported To "..getCreatureName(cid)..".")[/B]
setPlayerStorageValue(cid, 8778,0)
end
else
if getPlayerStorageValue(cid,8778,0) then
doPlayerSendCancel(cid, "Sorry you cant teleport.")
return true
end
end
end
end
Remember that 'cid' = 'you'.
If you want to make it check for another player you have to specify it.
In this case it would be something like:
Code:
local player = getPlayerByNameWildcard(param)
 
Last edited:
@ Coladus that would be awsome xD thank you :D

@ Ratser ahh okay thank you il remember that :P thank you for telling me i did not know that i thought cid = defaild for any item , object or player :P
 
@ Ratser ahh okay thank you il remember that :P thank you for telling me i did not know that i thought cid = defaild for any item , object or player :P

lol...it was because you used 'getCreatureName(cid)' in:
Code:
doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported To "..getCreatureName(cid)..".")
instead of: 'getCreatureName(getPlayerByNameWildcard(param))'
 
so now i need to have this ?

Code:
local player = getPlayerByNameWildcard(param)
function onSay(cid, words, param, channel)
if param == "" or not revange then
		return doPlayerSendCancel(cid, "Command param required.")
	end
if getPlayerStorageValue(cid,8778,1) then
if (param) ~= string.lower(getPlayerByNameWildcard(param)) then
for _, party in ipairs(getPartyMembers(player)) do
doTeleportThing(party, Creature_pos(cid))
doSendMagicEffect(getCreaturePosition(party), math.random(0, CONST_ME_LAST))
doPlayerSendTextMessage(party, MESSAGE_INFO_DESCR, "Your team has been teleported To "..getCreatureName(getPlayerByNameWildcard(param).."."))
setPlayerStorageValue(cid, 8778,0)
end
else
if getPlayerStorageValue(cid,8778,0) then
doPlayerSendCancel(cid, "Sorry you cant teleport.")
return true
end
end
end
end

this returns command param requered
 
Ok i have fastly remade it as i couldnt find one :) :
This is for 0.4 ;
1- go to creature --> scripts[paste]
LUA:
local Rev_PLAYER = 9097      -- storage must be the same as the one in talkaction lua file
function onPrepareDeath(cid, deathList)
      if isPlayer(cid) and isPlayer(deathList[1]) then
         setPlayerStorageValue(cid,Rev_PLAYER,getCreatureName(deathList[1]))
	  end
	return true
end
function onLogin(cid)
    if getPlayerStorageValue(cid,Rev_PLAYER) ~= -1 then
	    doPlayerSendTextMessage(cid,19,"YOu have the ability to be telepored you and your party mates to yourk killer to get revenge.")
    end
	registerCreatureEvent(cid, "party")
  return true
end

--> Now go to creaturescripts .xml and paste these lines :
Code:
	<event type="preparedeath" name="party" script="xxxx.lua"/>
	<event type="login" name="log" script="xxxx.lua"/>
change the "xxxx" to the file name you created.

----------------------------------------------------------------------------

2- Now go to talkaction and make new file [paste this]
LUA:
local Rev_PLAYER = 9097

function onSay(cid, words, param, channel)
    if getPlayerStorageValue(cid,Rev_PLAYER) == -1 then
	       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You dont have a killer or you already took your revenge.")
	else
	      local search = 0
	       for _, tid in ipairs(getPlayersOnline())  do
			   if string.lower(getCreatureName(tid)) == tostring(getPlayerStorageValue(cid,Rev_PLAYER)) then
					     search = true
			   else 
					     search = false
			    end
			
		   end
		   local killer = string.lower(getPlayerByNameWildcard(getPlayerStorageValue(cid,Rev_PLAYER)))
		   local pid = getThingPos(killer)
		   local pos = {x= pid.x+1,y= pid.y,z=pid.z}
		   if (search == true) then
		      doTeleportThing(cid,pos,false)
			  doSendMagicEffect(pos,10)
			  addEvent(doSendAnimatedText,100,pos,"Revenge!",10)
			  setPlayerStorageValue(cid,Rev_PLAYER,-1)
			   if isInParty(cid) then
		         for _, party in ipairs(getPartyMembers(cid)) do
				    if party ~= cid then
				       doTeleportThing(party,pos,false)
					   doPlayerSendTextMessage(party,19,getCreatureName(cid).." have summoned you to help him take revenge on his killer.")
			           doSendMagicEffect(pos,10)
				    end
				 end
			   end
		   else
			   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Seems Your killer have logged out.")
		   end
	end
 return true
end

I assume you know what to put in talkaction.xml :)
 
Last edited:
@Damadger, I was rather thinking that each party member had to write e.g. /revenge PlayerName (which is name of the one who died) and they would teleport to his killer.


However at this whole idea I must just say that it's not good for an RPG server since you can teleport into quests and whatnot!
 
actually you need to recopy now :) , cause the version i posted was wrong.

@colandus
can be done but i asked him if all party members will be teleported and he said yes. :)
 
i have tested the script and its not working for me when i let my brother kill me on my char and i log back in and join my other char in my party and type /revange playername i get this

2:56 You dont have a killer or you already took your revenge.

i have added everything just the way u told me to also i have used the same uniqueid as in the lua file that u gave me
 
as i told you copy the script after i edited
You copied it before and just type /revenge (no player name)


And unique id?/ what you talking about lol??
 
okay its all inside the good way but 1 thing i do get the playerstoragevalue when i die
but when i type /revange i get this

23:17 Seems Your killer have logged out. even though the char is standing outside of pz with ws
 
Back
Top