• 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,827
Solutions
586
Reaction score
5,409
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:
Code:
 local premtobuyhouse = 4
      
        if(premtobuyhouse > getPlayerPremiumDays(cid)) then
            doPlayerSendCancel(cid, 'You need at least 5 premium days to buy a house.')
            return false
        end
for example, you can use that OR
Code:
if(getPlayerPremiumDays) < 5 then
    doPlayerSendCancel(cid, 'You need at least 5 premium days to buy a house.')
    return false
end

do these edits in data/game_classes/house.lua if you have it.

sorry if you didn't want me to help him out with this xikini :)
 
@Codex NG Yeah, I prefer the creature performs the action visually.

But I think that no one will do it for free so the "automaticlly loot the gold if the player has summon" would be cool too.
Why not just automatically loot the gold if the player has a summon, or do you want the creature to perform the action visually?
This is way out of my experience range. I wouldn't even know where to start. Sorry.
Code:
 local premtobuyhouse = 4
     
        if(premtobuyhouse > getPlayerPremiumDays(cid)) then
            doPlayerSendCancel(cid, 'You need at least 5 premium days to buy a house.')
            return false
        end
for example, you can use that OR
Code:
if(getPlayerPremiumDays) < 5 then
    doPlayerSendCancel(cid, 'You need at least 5 premium days to buy a house.')
    return false
end

do these edits in data/game_classes/house.lua if you have it.

sorry if you didn't want me to help him out with this xikini :)
Quite fine. :p
Hello , can i request a script for 0.4
if i click on statue(actionid) and put item(xxx) on coal basin(xxx/xxx/x)
and click statue i get another item id on coal basin(xxx/xxx/x) , if no item on coal basin it says put the item on
and player with is in position(xxx/xxx/x ) can use the statue people from other xxx/xxx/x with clicks statue gets cancel back with POFF :D sorry for my broken english :D

edit. aswell on use statue it takes your 20 soul if player doesnt have enought soul on click statue it says "you don't have enought soul to change item"
Alright, I don't quite understand.

You have a room with a statue, and a coal basin.
If player uses statue, and an item is on coal basin,
remove item, and replace with another item.
^ This part I understand
What I don't understand is the next part about multiple people in the room.
Do you mean the person clicking the statue must be standing on a certain square?
Or is there tiles in the room that need to have players standing on it?
 
This is way out of my experience range. I wouldn't even know where to start. Sorry.

Quite fine. :p

Alright, I don't quite understand.

You have a room with a statue, and a coal basin.
If player uses statue, and an item is on coal basin,
remove item, and replace with another item.
^ This part I understand
What I don't understand is the next part about multiple people in the room.
Do you mean the person clicking the statue must be standing on a certain square?
Or is there tiles in the room that need to have players standing on it?
Do you mean the person clicking the statue must be standing on a certain square? yes :) and if player doesnt stand in certain square and clicks statue he gets poff message and hits player -500hp and steals 5 soul and gets message , you need to stand near coal basin to use magicians statue ^^
 
@Xikini
So I have got a request.
Once per 10 minutes items of ID 2260 will be removed from the map.
TFS v0.3.6pl of course.
I know that maybe it's simple, but I'm weak in these globalevents things.
Thanks in advance.
 
@Xikini
So I have got a request.
Once per 10 minutes items of ID 2260 will be removed from the map.
TFS v0.3.6pl of course.
I know that maybe it's simple, but I'm weak in these globalevents things.
Thanks in advance.
Is this for the entire map? Because that will probably lag your entire server, every 10 minutes.
If this item is supposed to have an expiration of 10 minutes.. it might be easier to simply put a decay on it, through items.xml
 
@Xikini Looking for script which makes your summon collecting money from loot. I don't even know if this is possible, but I will give you the chance haha.
Thanks in advnace. :cool:

0.3.6pl
It is possible but would need a lot of changes in the source (mostly because its 0.3.6, but it would still need source changes in 1.2)
 
Do you mean the person clicking the statue must be standing on a certain square? yes :) and if player doesnt stand in certain square and clicks statue he gets poff message and hits player -500hp and steals 5 soul and gets message , you need to stand near coal basin to use magicians statue ^^
Code:
-- <action actionid="45719" event="script" value="because_reasons.lua"/>

local cfg = {
     coal_basin_pos = {x = 1320, y = 1336, z = 7, stackpos = 2},
     tile_pos = {x = 1321, y = 1335, z = 7},
     require_item = 1988,
     give_item = 2386
}
  
function onUse(cid, item, fromPosition, itemEx, toPosition)

     standPos = getCreaturePosition(cid)
     if (standPos.x ~= tile_pos.x or standPos.y ~= tile_pos.y or standPos.z ~= tile_pos.z) then
         doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
         doPlayerAddSoul(cid, -5)
         if getCreatureHealth(cid) > 500 then
             doCreatureAddHealth(cid, -500)
         else
             doCreatureAddHealth(cid, -(getCreatureHealth(cid) - 1))
         end
         return doPlayerSendCancel(cid, "I require your feet over there. Because reasons.")
     end
    
     if getPlayerSoul(cid) >= 20 then
         if getTileItemById(cfg.coal_basin_pos, cfg.require_item).uid > 1 then
             doPlayerAddSoul(cid, -20)
             doRemoveItem(getTileItemById(cfg.coal_basin_pos, cfg.require_item).uid, 1)
             doCreateItem(cfg.give_item, 1, cfg.coal_basin_pos)
             doCreatureSay(cid, "Magical Transformations!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
             doCreatureSay(cid, "Oooh! Fireworks!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
             doSendMagicEffect(cfg.coal_basin_pos, CONST_ME_FIREWORK_RED)
         else
             return doPlayerSendCancel(cid, "Where my items? :(... No seriously. Items or die.  plz")
         end
     else
         return doPlayerSendCancel(cid, "I require soul to transform items.")
     end
  
   return true
end
 
Last edited:
Code:
-- <action actionid="45719" event="script" value="because_reasons.lua"/>

local cfg = {
     coal_basin_pos = {x = 1320, y = 1336, z = 7, stackpos = 2},
     tile_pos = {x = 1321, y = 1335, z = 7},
     require_item = 1988,
     give_item = 2386
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)

     standPos = getCreaturePosition(cid)
     if (standPos.x ~= tile_pos.x or standPos.y ~= tile_pos.y or standPos.z ~= tile_pos.z) then
         doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
         doPlayerAddSoul(cid, -5)
         if getCreatureHealth(cid) > 500 then
             doCreatureAddHealth(cid, -500)
         else
             doCreatureAddHealth(cid, -(getCreatureHealth(cid) - 1))
         end
         return doPlayerSendCancel(cid, "I require your feet over there. Because reasons.")
     end
   
     if getPlayerSoul(cid) >= 20 then
         if getTileItemById(cfg.coal_basin_pos, cfg.require_item).uid > 1 then
             doPlayerAddSoul(cid, -20)
             doRemoveItem(getTileItemById(cfg.coal_basin_pos, cfg.require_item).uid, 1)
             doCreateItem(cfg.give_item, 1, cfg.coal_basin_pos)
             doCreatureSay(cid, "Magical Transformations!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
             doCreatureSay(cid, "Oooh! Fireworks!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
             doSendMagicEffect(cfg.coal_basin_pos, CONST_ME_FIREWORK_RED)
         else
             return doPlayerSendCancel(cid, "Where my items? :(... No seriously. Items or die.  plz")
         end
     else
         return doPlayerSendCancel(cid, "I require soul to transform items.")
     end
 
   return true
end
sorry but i got this :(

PHP:
[17:22:38.713] [Error - Action Interface]
[17:22:38.713] data/actions/scripts/heartintoheart.lua:onUse
[17:22:38.713] Description:
[17:22:38.713] data/actions/scripts/heartintoheart.lua:11: attempt to index global 'tile_pos' (a nil value)
[17:22:38.713] stack traceback:
[17:22:38.713]  data/actions/scripts/heartintoheart.lua:11: in function <data/actions/scripts/heartintoheart.lua:8>
 
Xikini made this thread to learn more about Lua and get better at it. Not to learn to use the OTland search function.
tarek i just asked if he could me a working script if he can't he say it not you i searched 1000 times and i got the common thread but there is problems !!!!
 
sorry but i got this :(

PHP:
[17:22:38.713] [Error - Action Interface]
[17:22:38.713] data/actions/scripts/heartintoheart.lua:onUse
[17:22:38.713] Description:
[17:22:38.713] data/actions/scripts/heartintoheart.lua:11: attempt to index global 'tile_pos' (a nil value)
[17:22:38.713] stack traceback:
[17:22:38.713]  data/actions/scripts/heartintoheart.lua:11: in function <data/actions/scripts/heartintoheart.lua:8>
Hmm.. I thought it would work no problem putting it into the local config. Not sure why it shouldn't/wouldn't work.
This is the one I tested, and it is fully functional. o_O :oops:
Code:
-- <action actionid="45719" event="script" value="because_reasons.lua"/>

local cfg = {
   coal_basin_pos = {x = 1320, y = 1336, z = 7, stackpos = 2},
   require_item = 1988,
   give_item = 2386
}
   
function onUse(cid, item, fromPosition, itemEx, toPosition)

   tilePos = {x = 1321, y = 1335, z = 7}
   standPos = getCreaturePosition(cid)
   if (standPos.x ~= tilePos.x or standPos.y ~= tilePos.y or standPos.z ~= tilePos.z) then
     doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
     doPlayerAddSoul(cid, -5)
     if getCreatureHealth(cid) > 500 then
       doCreatureAddHealth(cid, -500)
     else
       doCreatureAddHealth(cid, -(getCreatureHealth(cid) - 1))
     end
     return doPlayerSendCancel(cid, "I require your feet over there. Because reasons.")
   end
   
   if getPlayerSoul(cid) >= 20 then
     if getTileItemById(cfg.coal_basin_pos, cfg.require_item).uid > 1 then
       doPlayerAddSoul(cid, 20)
       doRemoveItem(getTileItemById(cfg.coal_basin_pos, cfg.require_item).uid, 1)
       doCreateItem(cfg.give_item, 1, cfg.coal_basin_pos)
       doCreatureSay(cid, "Magical Transformations!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
       doCreatureSay(cid, "Oooh! Fireworks!", TALKTYPE_ORANGE_1, false, 0, cfg.coal_basin_pos)
       doSendMagicEffect(cfg.coal_basin_pos, CONST_ME_FIREWORK_RED)
     else
       return doPlayerSendCancel(cid, "Where my items? :(... No seriously. Items or die.  plz")
     end
   else
     return doPlayerSendCancel(cid, "I require soul to transform items.")
   end
   
   return true
end
 
Hey could you script me a npc with any outfit that sells item id 11192 to players for 100 cc? And a summoner class that summons baby dragon llord, frost dragon baby, baby dragon, dragon,dragon lord, and frost dragon, that has 300 to 500 dmg for babies and 900 to 1600 dmg for the dragons? Thx
 
Hey could you script me a npc with any outfit that sells item id 11192 to players for 100 cc? And a summoner class that summons baby dragon llord, frost dragon baby, baby dragon, dragon,dragon lord, and frost dragon, that has 300 to 500 dmg for babies and 900 to 1600 dmg for the dragons? Thx
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)  npcHandler:onCreatureAppear(cid)  end
function onCreatureDisappear(cid)  npcHandler:onCreatureDisappear(cid)  end
function onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg)  end
function onThink()  npcHandler:onThink()  end
   
function getNpcName()    return getCreatureName(getNpcId()) end

function greet(cid)
   talkState[cid] = 0
   return true
end

function creatureSayCallback(cid, type, msg)
  if(not npcHandler:isFocused(cid)) then
  return false
  end
   
   local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
   
   if msgcontains(msg, "job") then
     selfSay("I sell carrion worm fangs for unquestionably high prices.", cid)
   elseif msgcontains(msg, "name") then
     selfSay("My name is " .. getNpcName() .. ".", cid)
     
     
   elseif msgcontains(msg, "carrion worm fang") then
     selfSay("Would you like to buy a carrion worm fang for one million (pinky in mouth) dollars?!.", cid)
     talkState[talkUser] = 1

   elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
     if getPlayerMoney(cid) < 1000000 then
       selfSay("U hav no got enuf monies. :(", cid)
       talkState[talkUser] = 0
       return true
     end
     selfSay("Great. Here you are. :)", cid)
     doPlayerRemoveMoney(cid, 1000000)
     doPlayerAddItem(cid, 11192, 1, true)
     talkState[talkUser] = 0

   end
   return true   
end

npcHandler:setCallback(CALLBACK_GREET, greet)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Ok lets try this ^^ so im trying to get a VIP script for TFS 0.4 but i already have VIP in my database & site its called 'vip_time' i just want a VIP item with effect like it will say 'VIP!' over the player ;d im guessing action + creaturescript + globalevents?
 
Status
Not open for further replies.
Back
Top Bottom