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

problem warserver

drakanog

New Member
Joined
May 15, 2012
Messages
8
Reaction score
0
hello,i am testing and i have some errors


when i died by my fire field rune,i win money,the server has a system that if u kill 2 times the same player,the second time u no win money,how can i quit this and only put that if u kill players you win a item and if i died by my fire no win nothing for no be cheating?

and other thing is,how can i do an item that when i use the item i win 300 exp?


other thing,where can i change the level of armors?


thanks and greetings
 
Here's is the item exp thingy;

Lua:
function onUse(cid, item, frompos, item2, topos)

  if doPlayerAddExp(cid, 300) TRUE then
 doPlayerSendTextMessage(cid,22,"You Earned 300 EXP" <-- MADE BY UMBLED, PLEASE REP IF IT WORKED -->
 
  end
  return TRUE
end

How To;
Create a LUA file called "expitem"
Go To Data/Actions/Actions.xml
write in this;

Lua:
]<action itemid="WRITE THE ITEMID" script="expitem.lua"/>

PLEASE +REP IF IT WORKED
 
Last edited:
Umbled, fix your tabs and you are doing the comment tags wrong... This is a simple one...

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local exP = 300
	doPlayerAddExperience(cid, exP)
	doSendAnimatedText(getCreaturePosition(cid), exP, TEXTCOLOR_WHITE)
	return true
end
 
You don't say!
Look what I said before... I never said your script didn't work, just said that you needed some tag fixin' and comment tags...

don't; "<---->"
do; "--"

You don't need any "IF" statement there...
 
Lua:
function onUse(cid, item, frompos, item2, topos)
	if(doPlayerAddExp(cid, 300) == TRUE) then
		doPlayerSendTextMessage(cid,22,"You Earned 300 EXP") -- MADE BY UMBLED, PLEASE REP IF IT WORKED
	end
	return TRUE
end
Thats your script without any bugs n' fixed tabs.

Just saw that you had forgot many things, and you upload it to him?
 
okey thanks but when i use the item,the item dont lose the amount of uses,for example if i have 20 of this item,all time have 20,how can i do that this item be how the food?

and other thing,when i use the item,for a large time,apear the message that say You Earned 300 EXP
but how can i change the time to clear faster?

thanks all
 
Replace my old script with this one


Lua:
 function onUse(cid, item, frompos, item2, topos)

  if doPlayerAddExp(cid, 300) TRUE then
 doPlayerSendTextMessage(cid,22,"You Earned 300 EXP" -- MADE BY UMBLED, PLEASE REP IF IT WORKED
 doRemoveItem(item.uid, 1)
  end
  return TRUE
end
 
Last edited:
What the fudge Umbled... Do you even know what you are writing on your scripts/posts?

That local charges = 1 has no value or function in he script... He want it to be removed very time he clicks on it.

Here drakanog, here is the script you've been requesting:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local exP = 300
	doPlayerAddExperience(cid, exP)
	doSendAnimatedText(getCreaturePosition(cid), exP, TEXTCOLOR_WHITE)
	doRemoveItem(item.uid, 1) -- removes one charge on use
	return true
end
 
@umbled You might want to learn how if statements work, and what operators are..
And stop using TRUE instead of true, it's a horrible habit from someone that sticks around for some dumb reason.

I severely recommend you to test your scripts first before posting them here, as they just clearly don't work at first sight.

@TS; WarOfTheTitans' script will work for you.
 
Sorry for making shitty scripts, this one is actually working! tested by me.

Lua:
 function onUse(cid, item, frompos, item2, topos)
 
  doPlayerAddExp(cid, 300)
 doPlayerSendTextMessage(cid,22,"You Earned 300 EXP") -- MADE BY UMBLED, PLEASE REP IF IT WORKED
 doRemoveItem(item.uid, 1)
 return TRUE
end
 
Okei thanks all now i need help with other thing.

if i be killed by my firebomb rune,i win the reward andi want that if i dead by my fire i dont win nothing for that players not be doing cheat

i have this script

Lua Code:
function onDeath(cid, corpse, deathList)
local reward = {
item = 11192,
count = 1
}
for i = 1, #deathList do
if isPlayer(cid) and isPlayer(deathList) then
--[[if getPlayerIp(cid) ~= getPlayerIp(deathList) then ]]--
if getPlayerItemCount(deathList, reward.item) > 0 then
local item = getPlayerItemById(deathList, true, reward.item)
if item.type >= ITEMCOUNT_MAX then
doPlayerAddItem(deathList, reward.item, reward.count)
doCreatureSetStorage(deathList, 20233, getPlayerStorageValue(deathList, 20233)+1)
doSendAnimatedText(getPlayerPosition(deathList), "Frag!", TEXTCOLOR_RED)
else
doTransformItem(item.uid, reward.item, item.type + 1)
doCreatureSetStorage(deathList, 20233, getPlayerStorageValue(deathList, 20233)+1)
doSendAnimatedText(getPlayerPosition(deathList), "Frag!", TEXTCOLOR_RED)
end
else
doPlayerAddItem(deathList, reward.item, reward.count)
doCreatureSetStorage(deathList, 20233, getPlayerStorageValue(deathList, 20233)+1)
doSendAnimatedText(getPlayerPosition(deathList), "Frag!", TEXTCOLOR_RED)
end
--[[else
doPlayerSendTextMessage(deathList, 18, "You didn't get frag/reward because of killing a player with same ip.")

end ]]--
end
end
return true
end


and how can i change the skills of my server?i want to change the skills of all vocations for when i create a char,only have 2 ml and the other skills to 10.At the moment when i create a char i start with ml 20.

i have this script on my server

Lua Code:
function onLogin(cid)
local playerVoc = getPlayerVocation(cid)
local reqTries = getPlayerRequiredSkillTries
local skillStor = 56364
local gotSkills = getPlayerStorageValue(cid, 56364)


if playerVoc == 5 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,20)))
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 6 and gotSkills == -1 then
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,20)))
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 7 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 20))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 20))
doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,10)))
setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 8 and gotSkills == -1 then
doPlayerAddSkillTry(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 20))
doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 20))
doPlayerAddSkillTry(cid, SKILL_CLUB, reqTries(cid, SKILL_CLUB, 20))
doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 20))
doPlayerAddMagLevel(cid, 8)
setPlayerStorageValue(cid, skillStor, 1)

end
return TRUE
end


this sv is a war server pvp-e and when i put the start items,i want to put on principal items a Backpack of Holding but when i create the char,i have on principal backpack with all items a normal backpack and on the arrow site the backpack of holding,i only want that when i create a char,have only a backpack of holding and quit the principal backpack

with yours help i can finish my server!! thanks
 
Back
Top