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

Need some help about script..

lol94

Loler
Joined
Dec 23, 2008
Messages
764
Reaction score
55
Location
Mexico
Hey! what's up Otland!, so.. I am doing a War server.. so..
1.- Im looking for a frag script... I mean.. if you kill a pk or a player.. that the game gives you 100 gps everytime you kill a person, how can i script that?

2.- How to dont loose any item or level if you die?

Thank you SO MUCH Otland, will REP+ if you helpme :-)
 
( I was free, and boared)
LUA:
local money = 100     --money in gp
 function onKill(cid,target, lastHit)

  if isPlayer(cid) and isPlayer(target) then  --checks if the one that is attacking is a player, and checks if the one being attackes is a player
    
      if lastHit then  --checks if this is the last hit killer

         doPlayerAddMoney(cid,money)  -- this add the money to the player in gp's value
         
        doPlayerSendTextMessage(cid,22,"You have got "..money.." gp for killing "..getCreatureName(target)..".")  
              --In this line there is some stuff. 
              --First this function send a message to the player(cid) and it is a orange message in console (as the "22" state the msg class)
              -- Second we write the message in "" .
              -- What about those ".. money.." and "..getCreatureName(target).."??
              --Okay we as in our message we want the player to know how money he got , and this value is assigned to the local varible money..
              --To get its value as a string, we use the string concatenation operator(..).
              -- like that we stated that ..money.. will be copyied from the varible money as a string that can be output as a message.
              -- As for "..getCreatureName(target).." this to get the player killed name :),  we put in concatenation operator  to state it not to be typed as it is as a messgae but it get the data as string. :p

      end  --each if has an end
  end 
return true 
end




Hey! what's up Otland!, so.. I am doing a War server.. so..
2.- How to dont loose any item or level if you die?

For all players even red skulled?
 
LUA:
function onPrepareDeath(cid, deathList)
doSetCreatureDropLoot(cid,false)  -- but this wont create a body
return true
end
 
Back
Top