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

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

Status
Not open for further replies.

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,824
Solutions
586
Reaction score
5,403
Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

For clarity's sake,
I will script actionscripts, creaturescripts, globalevents, talkactions, movements, npcs for you.
I will not script spells, weapons, raids or monster scripts.
Additionally, source editing, websites and database queries are a no go as well.

Code:
How to make shorter links to posts.
https://otland.net/threads/234306/page-14#post-2330703
 
Last edited:
Script is awesome mate! it does work! but it needs some configurations ;)

Like if no one steps in it, it should disappear after lets say 1 minute.
and that you cant pick up the trap or move it, but i think that needs to change in the items.xml itself?
 
Last edited:
Script is awesome mate! it does work! but it needs some configurations ;)

Like if no one steps in it, it should disappear after lets say 1 minute.
and that you cant pick up the trap or move it, but i think that needs to change in the items.xml itself?
What you could do is use an addEvent and remove the item after 1 minute, or maybe try it in items.xml to keep it simple.
why the bump?
 
Script is awesome mate! it does work! but it needs some configurations ;)

Like if no one steps in it, it should disappear after lets say 1 minute.
and that you cant pick up the trap or move it, but i think that needs to change in the items.xml itself?
There is a special function for 0.3.7 in creaturescripts called 'throw'.
I'm entirely uncertain if it works in 0.3.6 or 0.4, but it would handle the trap being picked up or moved, all you'd need to do is add an actionID to the trap when it's created.

jXp3uhF.png

data/creaturescripts/creaturescript.xml

Code:
<event type="throw" name="moveBlocked" event="script" value="moveBlocked.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near the bottom with the other registered events]
Code:
registerCreatureEvent(cid, "moveBlocked")
data/creaturescripts/scripts/moveBlocked.lua
Code:
local c = {
   aid = 66666, -- ActionID to put on Objects.
   msg = "You cannot move this object." -- Message that appears when trying to move it.
}

function onThrow(cid, item, fromPosition, toPosition)
   if getItemAttribute(item.uid, "aid") == c.aid then
     return doPlayerSendCancel(cid, c.msg) and false
   end
   return true
end
 
You could help me create a function?
with the following code:

Code:
          local slots = {
        ['head'] = CONST_SLOT_HEAD,
        ['armor'] = CONST_SLOT_ARMOR,
        ['legs'] = CONST_SLOT_LEGS,
        ['feet'] = CONST_SLOT_FEET,
        ['left'] = CONST_SLOT_LEFT,
        ['right'] = CONST_SLOT_RIGHT
    }                
                local itemSlots, total = {}, 0
                for slot, const in pairs(slots) do
                    local hasItemOn = getPlayerSlotItem(cid, const).uid
                    if hasItemOn ~= 0  then
                        itemSlots[slot] = hasItemOn
                    end
                end

                for slot, slottedItem in pairs(itemSlots) do
                local temp = getItemAttribute(slottedItem, 'IceProtec')
                total = total + (temp ~= nil and temp or 0 )
                end

the function would look like:
getPlayerProtection(cid, attribute)
for use:
getPlayerProtection(cid, 'IceProtec')
getPlayerProtection(cid, 'FireProtec')
getPlayerProtection(cid, 'HolyProtec')
getPlayerProtection(cid, 'DeathProtec') etc etc
 
There is a special function for 0.3.7 in creaturescripts called 'throw'.
I'm entirely uncertain if it works in 0.3.6 or 0.4, but it would handle the trap being picked up or moved, all you'd need to do is add an actionID to the trap when it's created.

jXp3uhF.png

data/creaturescripts/creaturescript.xml

Code:
<event type="throw" name="moveBlocked" event="script" value="moveBlocked.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near the bottom with the other registered events]
Code:
registerCreatureEvent(cid, "moveBlocked")
data/creaturescripts/scripts/moveBlocked.lua
Code:
local c = {
   aid = 66666, -- ActionID to put on Objects.
   msg = "You cannot move this object." -- Message that appears when trying to move it.
}

function onThrow(cid, item, fromPosition, toPosition)
   if getItemAttribute(item.uid, "aid") == c.aid then
     return doPlayerSendCancel(cid, c.msg) and false
   end
   return true
end
you meant
Code:
return doPlayerSendCancel(cid, c.msg), false
or
Code:
doPlayerSendCancel(cid, c.msg)
return false
right?

I wonder if doPlayerSendCancel actually returns a value, if it does, is it false? if it is then false and false would be true :(
 
There is a special function for 0.3.7 in creaturescripts called 'throw'.
I'm entirely uncertain if it works in 0.3.6 or 0.4, but it would handle the trap being picked up or moved, all you'd need to do is add an actionID to the trap when it's created.

jXp3uhF.png

data/creaturescripts/creaturescript.xml

Code:
<event type="throw" name="moveBlocked" event="script" value="moveBlocked.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near the bottom with the other registered events]
Code:
registerCreatureEvent(cid, "moveBlocked")
data/creaturescripts/scripts/moveBlocked.lua
Code:
local c = {
   aid = 66666, -- ActionID to put on Objects.
   msg = "You cannot move this object." -- Message that appears when trying to move it.
}

function onThrow(cid, item, fromPosition, toPosition)
   if getItemAttribute(item.uid, "aid") == c.aid then
     return doPlayerSendCancel(cid, c.msg) and false
   end
   return true
end
uhm. isn't 0.3.7 and 0.4 the same thing? :p
 
uhm. isn't 0.3.7 and 0.4 the same thing? :p
0.4 They tried to downsize the more 'buggy' scripts, as there were lot's of scripts being added that were frankly never used. They tried to build stability over customization, and as such a lot of functions were removed, but yes, the functions that remain are almost all the same.
you meant
Code:
return doPlayerSendCancel(cid, c.msg), false
or
Code:
doPlayerSendCancel(cid, c.msg)
return false
right?

I wonder if doPlayerSendCancel actually returns a value, if it does, is it false? if it is then false and false would be true :(
Do you have an easy way to test what it returns?
I'm drawing a blank on how to test this particular one.
Code:
return doPlayerSendCancel(cid, c.msg), false -- allows me to move the bag
-- unsure what the comma is meant to do. :(
Code:
doPlayerSendCancel(cid, c.msg) -- is the same as 'and false' if I'm not mistaken
return false -- but it works, of course. :P
 
Do you have an easy way to test what it returns?
I'm drawing a blank on how to test this particular one.
Code:
print( doPlayerSendCancel(cid, c.msg) )
if nil is printed to the console or nothing then it doesn't return a value.

The comma in a return value allows you to return more than 1 value.
Example:
Code:
function returnTwoValues()
    return 1, 2
end
local one, two = returnTwoValues()
When the values are returned the 1st value in this case 1 goes inside of the 1st variable one, the 2 goes in the 2nd variable two, if there was only 1 variable there to receive the return value then the 2nd return value would be discarded.
 
Last edited:
Would it be possible to let a npc only trade with you if you have wear the sniper gloves addon?

Player: Hi
Npc: Hello |player name| welcome too the marksman shop. What can I do for you.

Player say trade without wearing sniper gloves addon man/woman.

Npc: hahaha you are no marksman you would probably hurt yourself with this gear...
Beat it!

And if they wear the gloves

Npc: ofcourse take a look
Open trade window
Bow
Crossbow
Royal spear
 
Would it be possible to let a npc only trade with you if you have wear the sniper gloves addon?

Player: Hi
Npc: Hello |player name| welcome too the marksman shop. What can I do for you.

Player say trade without wearing sniper gloves addon man/woman.

Npc: hahaha you are no marksman you would probably hurt yourself with this gear...
Beat it!

And if they wear the gloves

Npc: ofcourse take a look
Open trade window
Bow
Crossbow
Royal spear
Yes
 
Would it be possible to let a npc only trade with you if you have wear the sniper gloves addon?

Player: Hi
Npc: Hello |player name| welcome too the marksman shop. What can I do for you.

Player say trade without wearing sniper gloves addon man/woman.

Npc: hahaha you are no marksman you would probably hurt yourself with this gear...
Beat it!

And if they wear the gloves

Npc: ofcourse take a look
Open trade window
Bow
Crossbow
Royal spear
If you have the npc file, post it here or pm me with it, and I'll add the outfit check for you.
 
I have some request for my ot, for a events zone can you help me?

I wanna know if u can help me to made a script to enter in some zone and kill a monster depends on level of whos step in some tile, but to end that event, every one whos enter in the event, need step in the tile and defeat their monster, and ends the event, go back to the teleport and enter in the reward zone, to click on a dice and depends on the number of the dice random givie you a random donation coins or event coins, but if u dont kill ur monster and dont have ur storage dont enter in the reward zone and back to temple or depot, can u made it? xD
 
TFS 0.3.6
1.Would need to do this one:
Code:
local config = {
        item = {ID1, ID2}
        }
function onKill(cid, target, lastHit)
        if isPlayer(cid) == TRUE and isPlayer(target) == TRUE and lastHit == TRUE then
                for i = 1, #config.item do
                    doPlayerAddItem(cid, config.item[i], 1)
                end
        end
    return TRUE
end

to input there
Code:
doTransformItem
to automatically stack rewarded items
2. Would be nice if you would do this too, i can look how many kills does he have, for example
"You see XYZ (Level X). He is master sorcerer. Frags: 41". Thanks :D
 
TFS 0.3.6
1.Would need to do this one:
Code:
local config = {
        item = {ID1, ID2}
        }
function onKill(cid, target, lastHit)
        if isPlayer(cid) == TRUE and isPlayer(target) == TRUE and lastHit == TRUE then
                for i = 1, #config.item do
                    doPlayerAddItem(cid, config.item[i], 1)
                end
        end
    return TRUE
end

to input there
Code:
doTransformItem
to automatically stack rewarded items
2. Would be nice if you would do this too, i can look how many kills does he have, for example
"You see XYZ (Level X). He is master sorcerer. Frags: 41". Thanks :D
Can you explain what you want the first script to do?
 
Status
Not open for further replies.
Back
Top