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

Chris77's Scripting Services

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

Well, thank FSM for that 10% cause it worked :thumbup: Btw I dont think that function is only for 3.5, Im using 0.3.2 and its on my LUA_FUNCTIONS list :eek:

Gotta research about that "table.maxn" part to see how it works and so on, seems useful, thanks a lot ;) Ill +Rep you again as soon as it lets me.

Cheers.
 
glad I could help. And I wasn't sure, I don't have the functions list for TFS0.3.4pl2 atm so I had to go by memory, I thought I seen it, guess so.
 
Definitions for FSM:

Code:
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

I dont know what kind of thank that is but some of those are mean! LOL
 
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
 
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

/skills Old Greg, mining

Lua:
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
 
The 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.xml
Code:
<event type="advance" name="Banana" event="script" value="Banana.lua" />

It shows this error in consol

[25/06/2009 10:45:36] [Warning - Event::loadScript] Event onAdvance not found (data/creaturescripts/scripts/Banana.lua)

help?
 
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

-- I love you to FIX.... But my life its change much more... (getCreatureMaxHealth(cid) + 500) << this up 1k... and mana 300 up 600, and if i remove armor health and mana, dont loose.... can you help me????
 
Type of Script: NPC
Player = RED
NPC = Blue
Ex:
Hi, Hiho, Learn, You want to learn minning skill?, Yes, Ok. If you give-me 50 gold coins you learn the minning skill.
Hi, Hiho, Upgrade, You want upgrade your minning skill to level 2?, Yes, I need 370 gold coins to upgrade your minning skill.
Priority: Normal
Reason of Request: I am making a real server, based on some other games.
Description: He will give you: minning skill.
Public/Private: Public
More: A talkaction, If I say '!additionalskills', appear a msg like a book:
You have: minning skill(level 1).
 
Last edited:
The 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.xml
Code:
<event type="advance" name="Banana" event="script" value="Banana.lua" />

It shows this error in consol



help?
Change this
Code:
<event type="advance" name="Banana" event="script" value="Banana.lua" />
to this
Code:
<event type="death" name="Banana" event="script" value="Banana.lua" />

:thumbup:
 
Back
Top