function doPlayerAddSummon(cid, name, pos)
local MyCreature = doSummonCreature(name, pos)
doConvinceCreature(cid, MyCreature)
end
function onSay(cid, words, param, channel)
local level = 30
local mana = 200
local vocsCanUse = {1, 2, 3, 4, 5, 6, 7,8}
local condition = CONDITION_DRUNK
local canBeSummoned = {"Dog", "Troll", "Bug", "Fire Devil", "Fire Elemental"}
local summons = getCreatureSummons(cid)
if(table.maxn(summons) >= 2) then
doPlayerSendCancel(cid, "You may not summon more than 2 creatures.")
return TRUE
end
if getPlayerLevel(cid) < level then
doPlayerSendCancel(cid, "Your level is too low.")
return TRUE
end
if getCreatureMana(cid) < mana then
doPlayerSendCancel(cid, "You do not have enough mana.")
return TRUE
end
if(not isInArray(vocsCanUse, getPlayerVocation(cid))) then
doPlayerSendCancel(cid, "Your vocation cannot use this spell.")
return TRUE
end
if getCreatureCondition(cid, condition) == FALSE then
doPlayerSendCancel(cid, "You need to be drunked to use this spell.")
return TRUE
end
if(not isInArray(canBeSummoned, param)) then
doPlayerSendCancel(cid, "You cannot summon this creature.")
return TRUE
end
doPlayerAddSummon(cid, param, getCreaturePosition(cid))
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
return TRUE
end
Lua:function doPlayerAddSummon(cid, name, pos) local MyCreature = doSummonCreature(name, pos) doConvinceCreature(cid, MyCreature) end function onSay(cid, words, param, channel) local level = 30 local mana = 200 local vocsCanUse = {1, 2, 3, 4, 5, 6, 7,8} local condition = CONDITION_DRUNK local canBeSummoned = {"Dog", "Troll", "Bug", "Fire Devil", "Fire Elemental"} local summons = getCreatureSummons(cid) if(table.maxn(summons) >= 2) then doPlayerSendCancel(cid, "You may not summon more than 2 creatures.") return TRUE end if getPlayerLevel(cid) < level then doPlayerSendCancel(cid, "Your level is too low.") return TRUE end if getCreatureMana(cid) < mana then doPlayerSendCancel(cid, "You do not have enough mana.") return TRUE end if(not isInArray(vocsCanUse, getPlayerVocation(cid))) then doPlayerSendCancel(cid, "Your vocation cannot use this spell.") return TRUE end if getCreatureCondition(cid, condition) == FALSE then doPlayerSendCancel(cid, "You need to be drunked to use this spell.") return TRUE end if(not isInArray(canBeSummoned, param)) then doPlayerSendCancel(cid, "You cannot summon this creature.") return TRUE end doPlayerAddSummon(cid, param, getCreaturePosition(cid)) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) return TRUE end
90% sure it wont work but it gives you something to go on. Btw that function might not work in 3.4pl2 its from 3.5 list, but it should
1. FSM
Flying Spaghetti Monster:
2. FSM
FRIDAY-SATURDAY MELTDOWN:
3. FSM
FANTASTIC SLOW MASTURBATION:
4. FSM
FEMALE SLUT MAGNET:
5. FSM
Fat Stomach Man:
6. FSM
Female Seeking Male
7. FSM
Field Service Manager
8. FSM
Finite State Machine
9. FSM
Fat Slut (from) Mahopac
10. FSM
Fat Smelly Man or Fat Stinky Man
im hoping he meant flying spagetti monster
or ima be offended
Type of Script: Talkaction
Priority: asap
Reason of Request: well i could make it just my hands are full atm need a starter script
Description: Basically I want it to display custom skill in a FYI box. Like mining, crafting, etc. just make up some names for now. Im using storage values to check the skills so check storage values for number of skill. something along those lines
Public
local skills = {
-- skillname = storage
["mining"] = 34301,
["crafting"] = 34302
}
function onSay(cid, words, param, channel)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return TRUE
end
local t = string.explode(param, ",")
local player = getPlayerByName(t[1])
if(not t[2]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ERROR] /skills playername, skillname")
return TRUE
end
if(isPlayer(player) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ERROR] This Player does not exists.")
return TRUE
end
local skill = skills[string.lower(t[2])]
if(skill) then
local getSkill = getPlayerStorageValue(player, skill)
if(getSkill == -1) then
getSkill = 1
end
doPlayerPopupFYI(cid, "[".. t[1] .."]: Ranking of ".. t[2] .."'s: " .. getSkill .. ".")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ERROR] ".. t[2] .." does not exists.")
end
return TRUE
end
Code:function onDeath(cid, corpse, killer) if isPlayer(killer) == TRUE then local item = doPlayerAddItem(killer, 2676, 1) end return TRUE end
Sounds good, any explication on how to use it? action?creature script? etc.
~Scripts~
Angel Power Tile.
(Status: Tested)
Request: http://otland.net/f132/old-greg-chris77s-scripting-services-37296/index2.html#post375918
Script: http://otland.net/f132/old-greg-chris77s-scripting-services-37296/index2.html#post376201
Where do you think if the function is onDeath? Ofc in creaturescript.<_<
function onDeath(cid, corpse, killer)
if isPlayer(killer) == TRUE then
local item = doPlayerAddItem(killer, 2676, 1)
end
return TRUE
end
<event type="advance" name="Banana" event="script" value="Banana.lua" />
[25/06/2009 10:45:36] [Warning - Event::loadScript] Event onAdvance not found (data/creaturescripts/scripts/Banana.lua)
loool why this *if getPlayerSlotItem(cid, CONST_SLOT_ARMOR).itemid == config.item then*
you already do that with *slot="armor"*
Lua:function onEquip(cid, item, slot) doPlayerSendTextMessage(cid, 25, "Health changed...") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + 500) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 300) return TRUE end function onDeEquip(cid, item, slot) doPlayerSendTextMessage(cid, 25, "Health changed...") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) - 500) setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 300) return TRUE end
Hi, Hiho, Learn, You want to learn minning skill?, Yes, Ok. If you give-me 50 gold coins you learn the minning skill.
Priority: NormalHi, Hiho, Upgrade, You want upgrade your minning skill to level 2?, Yes, I need 370 gold coins to upgrade your minning skill.
Change thisThe script from Trekes
Code:function onDeath(cid, corpse, killer) if isPlayer(killer) == TRUE then local item = doPlayerAddItem(killer, 2676, 1) end return TRUE end
Is not working, I've added it to creatures script/script and I named it banana.lua
Now, in-game when I kill someone I don't gain any bananas. also, when i add in creaturescript.xmlCode:<event type="advance" name="Banana" event="script" value="Banana.lua" />
It shows this error in consol
help?
<event type="advance" name="Banana" event="script" value="Banana.lua" />
<event type="death" name="Banana" event="script" value="Banana.lua" />
yeah im not good at adding skill through scripts just edit the addmanaspent function till u get it to work somehow lol