• 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
Premium User
Joined
Nov 17, 2010
Messages
6,793
Solutions
581
Reaction score
5,357
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:
The following scripts are intended for boss monsters, but can easily be used for normal creatures as well.
The script will give players additional storage values to be used elsewhere.

In this particular example the points are used for a teleport script.

Scripts to get storage when killing creatures.

creaturescripts/creaturescripts.xml

Code:
<event type="kill" name="AAAAAAAA" event="script" value="script.lua"/>
creaturescripts/scripts/login.lua (somewhere near the bottom with the other registered events)
Code:
registerCreatureEvent(cid, "AAAAAAAA")
creaturescripts/scripts/script.lua
Code:
local storage = 45001 -- storageID to use.
local maxPoints = 10 -- maximum amount of saved points a player can have
local givePoints = 1 -- amount of points to give player
local creatureName = 'cave rat' -- creaturename (must be lowercase letters)

function onKill(cid, target, damage, flags)

   if isPlayer(target) then
     return true
   end

   local name = getCreatureName(target):lower()
   if name ~= creatureName then
     return true
   end

   if getPlayerStorageValue(cid, storage) < 0 then
     doPlayerSetStorageValue(cid, storage, 0)
   end

   if getPlayerStorageValue(cid, storage) < maxPoints then
     doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + givePoints)
   end

   doCreatureSay(cid, 'You have defeated ' .. name .. '.', TALKTYPE_ORANGE_1)

   return true
end
--------------------------------
Scripts to use storage when entering teleport.

movements/movements.xml

Code:
<movevent type="StepIn" actionid="45001" event="script" value="script.lua"/>
movements/scripts/script.lua
Code:
local storage = 45001 -- storage used in creaturescript
local location = {x = 1000, y = 1000, z = 7} -- place you will teleport
local pointsRequired = 1 -- how many creature points required to teleport

function onStepIn(cid, item, position, fromPosition)
   if isPlayer(cid) ~= TRUE then
     return false
   end
   if getPlayerStorageValue(cid, storage) < 0 then
     doPlayerSetStorageValue(cid, storage, 0)
   end

   if getPlayerStorageValue(cid, storage) >= pointsRequired then
     doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage) - pointsRequired)
     doTeleportThing(cid, location)
   else
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You require ".. pointsRequired .." points to use this teleport. You currently have ".. getPlayerStorageValue(cid, storage) .." points.")
   end

   return true
end
creature event seems not working :(
i use 0.4

script
Code:
local storage = 343996 -- storageID to use.
local maxPoints = 10 -- maximum amount of saved points a player can have
local givePoints = 1 -- amount of points to give player
local creatureName = 'earth god' -- creaturename (must be lowercase letters)

function onKill(cid, target, damage, flags)

   if isPlayer(target) then
     return true
   end

   local name = getCreatureName(target):lower()
   if name ~= creatureName then
     return true
   end

   if getPlayerStorageValue(cid, storage) < 0 then
     doPlayerSetStorageValue(cid, storage, 0)
   end

   if getPlayerStorageValue(cid, storage) < maxPoints then
     doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + givePoints)
   end

   doCreatureSay(cid, 'You have defeated ' .. name .. '.', TALKTYPE_ORANGE_1)

   return true
end

registerCreatureEvent(cid, "killbossgetstorage")
<event type="kill" name="killbossgetstorage" event="script" value="killbossgetstorage.lua"/>

after i kill Earth God 1 or 10 nothing happens . can you help please ? ;)
 
I want free script
NPC CODE
1 code for one player
if player write code player reacive item *i want loading codes with storages or pernament

IF You make this script for free you are pro!
I paid another scripter and he scamed me :(
 
Last edited:
@Xikini

I've got a problem with Your script Arena.

I've got in Area_Death:

Lua:
local config = {
   reward_position = {x = 472, y = 12, z = 7}, -- Teleport location when Arena is Cleared.
   global_storage = 696969, -- any free storage
   top_left_corner = {x = 459, y = 15, z = 7}, -- top left corner of arena
   bottom_right_corner = {x = 470, y = 18, z = 7}, -- bottom right corner of arena
}
local monsters = { -- All monsters in arena (including joke monster)
   [1] = "Fighter",
   [2] = "Yamcha",
   [3] = "Ranfan",
   [4] = "Jackie Chun"
}
local monster_config_wave_one = { -- wave 1
   [1] = {position = {x = 468, y = 16, z = 7}, name = "Yamcha"}
}
local monster_config_wave_two = { -- wave 2
   [1] = {position = {x = 468, y = 16, z = 7}, name = "Ranfan"}
}
local monster_config_wave_three = { -- wave 3
   [1] = {position = {x = 468, y = 16, z = 7}, name = "Jackie Chun"}
}
function onKill(cid, target, damage, flags)
   -- check if target is player
   if isPlayer(target) then
     return true
   end
   -- check if target is on list of monsters in arena
   local name = getCreatureName(target):lower()
   count = 0
   for i = 1, #monsters do
     if name == monsters[i]:lower() then
       count = count + 1
     end
   end
   if count == 0 then -- if target is not on list
     return true
   end
   -- check if target is in area and add to global storage if it is
   for t = config.top_left_corner.x, config.bottom_right_corner.x do
     for f = config.top_left_corner.y, config.bottom_right_corner.y do
       pos = {x = t, y = f, z = 7}
       pid = getTopCreature(pos).uid
       if pid == target then
         setGlobalStorageValue(global_storage, getGlobalStorageValue(global_storage) + 1)
       end
     end
   end
   -- Start checks for waves of arena
   -- Wave 1
   if getGlobalStorageValue(global_storage) == 1 then
     for i = 1, #monster_config_wave_one do
       doCreateMonster(monster_config_wave_one[i].name, monster_config_wave_one[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 1.")
   end
   -- Wave 2
   if getGlobalStorageValue(global_storage) == 2 then
     for i = 1, #monster_config_wave_two do
       doCreateMonster(monster_config_wave_two[i].name, monster_config_wave_two[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 2.")
   end
   -- Wave 3
   if getGlobalStorageValue(global_storage) == 3 then
     for i = 1, #monster_config_wave_three do
       doCreateMonster(monster_config_wave_three[i].name, monster_config_wave_three[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 3. Final Wave.")
   end
   -- When final wave ends
   -- Teleport player
   if getGlobalStorageValue(global_storage) == 4 then
     doTeleportThing(cid, config.reward_position)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! Go collect your reward.")
     setGlobalStorageValue(global_storage, 0)
   end
   return true
end

And in action script:
Lua:
---------------------------------- Start Config -------------------------------
local config = {
   arena_position = {x = 462, y = 17, z = 7}, -- Player Arena Position
   failed_position = {x = 473, y = 10, z = 7}, -- Player took too long position
   lever_reset_time = 10, -- in minutes (how long until another player can kick them out)
   global_storage = 696969, -- any free storage
   top_left_corner = {x = 459, y = 15, z = 7}, -- top left corner of arena
   bottom_right_corner = {x = 470, y = 18, z = 7}, -- bottom right corner of arena
   joke_monster = "Fighter" -- They will kill this monster to start the waves
}
----------------------------------- End Config --------------------------------
local function reset(p)
   doTransformItem(getTileItemById(p, 1946).uid, 1945)
end
local function teleport(cid)
   doTeleportThing(cid, config.arena_position)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "---------------------------------------")
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Kill the training mate to start Tournament.")
   doCreateMonster(config.joke_monster, config.arena_position)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
   -- check if lever is currently used
   if item.itemid == 1946 then
     return doPlayerSendTextMessage(cid, 22, "Wait for switch to reset. It resets automatically every ".. config.lever_reset_time .." minutes.")
   end
   -- check for players/monsters in arena, and kick them out/remove them
   for t = config.top_left_corner.x, config.bottom_right_corner.x do
     for f = config.top_left_corner.y, config.bottom_right_corner.y do
       pos = {x = t, y = f, z = 7}
       pid = getTopCreature(pos).uid
       if isPlayer(pid) then
         doTeleportThing(pid, config.failed_position)
         doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Another player started the arena. You have been removed. Better luck next time!")
       end
       if isMonster(pid) then
         doRemoveCreature(pid)
       end
     end
   end
   -- tell player what to do
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Lever resets automatically every ".. config.lever_reset_time .." minutes.")
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Once the lever resets another player can start the arena.")
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "If your still inside when another player starts, you will be removed from the arena and unable to continue.")
   -- reset global storage
   setGlobalStorageValue(global_storage, 0)
   -- teleport player to arena, send start message, create start/joke monster
   addEvent(teleport, 5000, cid)
   -- transform lever, and add reset
   doTransformItem(item.uid, item.itemid + 1)
   addEvent(reset, ((config.lever_reset_time * 60 * 1000) + 5000), toPosition)
   return true
end

The problem is, that when I die on area i die like in normal and revive in the temple of my town. The 'loss' position not works. Why? What I made wrong?
Please hele me!
 
@Xikini

I've got a problem with Your script Arena.

I've got in Area_Death:

Lua:
local config = {
   reward_position = {x = 472, y = 12, z = 7}, -- Teleport location when Arena is Cleared.
   global_storage = 696969, -- any free storage
   top_left_corner = {x = 459, y = 15, z = 7}, -- top left corner of arena
   bottom_right_corner = {x = 470, y = 18, z = 7}, -- bottom right corner of arena
}
local monsters = { -- All monsters in arena (including joke monster)
   [1] = "Fighter",
   [2] = "Yamcha",
   [3] = "Ranfan",
   [4] = "Jackie Chun"
}
local monster_config_wave_one = { -- wave 1
   [1] = {position = {x = 468, y = 16, z = 7}, name = "Yamcha"}
}
local monster_config_wave_two = { -- wave 2
   [1] = {position = {x = 468, y = 16, z = 7}, name = "Ranfan"}
}
local monster_config_wave_three = { -- wave 3
   [1] = {position = {x = 468, y = 16, z = 7}, name = "Jackie Chun"}
}
function onKill(cid, target, damage, flags)
   -- check if target is player
   if isPlayer(target) then
     return true
   end
   -- check if target is on list of monsters in arena
   local name = getCreatureName(target):lower()
   count = 0
   for i = 1, #monsters do
     if name == monsters[i]:lower() then
       count = count + 1
     end
   end
   if count == 0 then -- if target is not on list
     return true
   end
   -- check if target is in area and add to global storage if it is
   for t = config.top_left_corner.x, config.bottom_right_corner.x do
     for f = config.top_left_corner.y, config.bottom_right_corner.y do
       pos = {x = t, y = f, z = 7}
       pid = getTopCreature(pos).uid
       if pid == target then
         setGlobalStorageValue(global_storage, getGlobalStorageValue(global_storage) + 1)
       end
     end
   end
   -- Start checks for waves of arena
   -- Wave 1
   if getGlobalStorageValue(global_storage) == 1 then
     for i = 1, #monster_config_wave_one do
       doCreateMonster(monster_config_wave_one[i].name, monster_config_wave_one[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 1.")
   end
   -- Wave 2
   if getGlobalStorageValue(global_storage) == 2 then
     for i = 1, #monster_config_wave_two do
       doCreateMonster(monster_config_wave_two[i].name, monster_config_wave_two[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 2.")
   end
   -- Wave 3
   if getGlobalStorageValue(global_storage) == 3 then
     for i = 1, #monster_config_wave_three do
       doCreateMonster(monster_config_wave_three[i].name, monster_config_wave_three[i].position)
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 3. Final Wave.")
   end
   -- When final wave ends
   -- Teleport player
   if getGlobalStorageValue(global_storage) == 4 then
     doTeleportThing(cid, config.reward_position)
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! Go collect your reward.")
     setGlobalStorageValue(global_storage, 0)
   end
   return true
end

And in action script:
Lua:
---------------------------------- Start Config -------------------------------
local config = {
   arena_position = {x = 462, y = 17, z = 7}, -- Player Arena Position
   failed_position = {x = 473, y = 10, z = 7}, -- Player took too long position
   lever_reset_time = 10, -- in minutes (how long until another player can kick them out)
   global_storage = 696969, -- any free storage
   top_left_corner = {x = 459, y = 15, z = 7}, -- top left corner of arena
   bottom_right_corner = {x = 470, y = 18, z = 7}, -- bottom right corner of arena
   joke_monster = "Fighter" -- They will kill this monster to start the waves
}
----------------------------------- End Config --------------------------------
local function reset(p)
   doTransformItem(getTileItemById(p, 1946).uid, 1945)
end
local function teleport(cid)
   doTeleportThing(cid, config.arena_position)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "---------------------------------------")
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Kill the training mate to start Tournament.")
   doCreateMonster(config.joke_monster, config.arena_position)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
   -- check if lever is currently used
   if item.itemid == 1946 then
     return doPlayerSendTextMessage(cid, 22, "Wait for switch to reset. It resets automatically every ".. config.lever_reset_time .." minutes.")
   end
   -- check for players/monsters in arena, and kick them out/remove them
   for t = config.top_left_corner.x, config.bottom_right_corner.x do
     for f = config.top_left_corner.y, config.bottom_right_corner.y do
       pos = {x = t, y = f, z = 7}
       pid = getTopCreature(pos).uid
       if isPlayer(pid) then
         doTeleportThing(pid, config.failed_position)
         doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Another player started the arena. You have been removed. Better luck next time!")
       end
       if isMonster(pid) then
         doRemoveCreature(pid)
       end
     end
   end
   -- tell player what to do
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Lever resets automatically every ".. config.lever_reset_time .." minutes.")
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Once the lever resets another player can start the arena.")
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "If your still inside when another player starts, you will be removed from the arena and unable to continue.")
   -- reset global storage
   setGlobalStorageValue(global_storage, 0)
   -- teleport player to arena, send start message, create start/joke monster
   addEvent(teleport, 5000, cid)
   -- transform lever, and add reset
   doTransformItem(item.uid, item.itemid + 1)
   addEvent(reset, ((config.lever_reset_time * 60 * 1000) + 5000), toPosition)
   return true
end

The problem is, that when I die on area i die like in normal and revive in the temple of my town. The 'loss' position not works. Why? What I made wrong?
Please hele me!
failed_position = {x = 473, y = 10, z = 7}, -- Player took too long position

When you die, you die like normal.
If you take too long, and someone else wants to try the arena, you will get kicked out to that position when they use the lever.
If you want people to not die in the arena, make the area a pvp-tile, in your map editor.
 
failed_position = {x = 473, y = 10, z = 7}, -- Player took too long position

When you die, you die like normal.
If you take too long, and someone else wants to try the arena, you will get kicked out to that position when they use the lever.
If you want people to not die in the arena, make the area a pvp-tile, in your map editor.
I want to revive after death in area on the failed position (too long position). Is it possible?
 
Last edited:
I want to revive after death in area on the failed position (too long position). Is it possible?
The way I would do it in a script would be to set a storage value of the player when they enter the arena and remove it when they exited as they normally would. But this storage value would serve the purpose of calling it when the player logins to check if they died while they were in the arena and if so to teleport them to the failed position.

So to answer your question yes it is possible.
 
hello bro u can help me in script when party have 4 different vocation get double exp ?

different vocation = {druid-- sorcere--knight- paladin}

for 0.4
 
hi um, just requesting a spell that makes you invulnerable for x time, also it does an effect on yourself each second
 
Add this to data/xml/groups.xml

Code:
<group id="4" name="invincable player" flags="3" access="0" maxdepotitems="0" maxvipentries="0" />

Then your spells....

Code:
local time_in_seconds = 5

function onCastSpell(creature, variant)
    player = Player(creature)
   
    player:setGroupId(4)
   
    addEvent(sendEffects, 0, player)
    addEvent(removeSpell, time_in_seconds * 1000, player)
    return true
end

function sendEffects(player)
    if player:getGroupId() == 4 then
        player:getPosition():sendMagicEffect(12)
        addEvent(sendEffects, 1000, player)
    end
end

function removeSpell(player)
    player:setGroupId(1)
end

Make sure the spell is aggressive so players cannot log out after they use it.
 
Add this to data/xml/groups.xml

Code:
<group id="4" name="invincable player" flags="3" access="0" maxdepotitems="0" maxvipentries="0" />

Then your spells....

Code:
local time_in_seconds = 5

function onCastSpell(creature, variant)
    player = Player(creature)
  
    player:setGroupId(4)
  
    addEvent(sendEffects, 0, player)
    addEvent(removeSpell, time_in_seconds * 1000, player)
    return true
end

function sendEffects(player)
    if player:getGroupId() == 4 then
        player:getPosition():sendMagicEffect(12)
        addEvent(sendEffects, 1000, player)
    end
end

function removeSpell(player)
    player:setGroupId(1)
end

Make sure the spell is aggressive so players cannot log out after they use it.

this error happens on console
b4i9m8.png
 
hmm works but it doesnt gives invulnerability also when activated you can no longer attack
here you go bud
XML:
<group id="4" name="invincible player" flags="8" access="0" maxdepotitems="0" maxvipentries="0" />

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local function resetGroup(cid)
    return Player(cid):setGroup(Group(1))
end

local function sendEffects(cid)
    local player = Player(cid)
    if not player then
        return
    end
    if player:getGroup():getId() == 4 then
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        addEvent(sendEffects, 1000, cid)
    end
end

function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    addEvent(resetGroup, 5000, player:getId())
    sendEffects(player:getId())
    return combat:execute(creature, variant)
end
 
here you go bud
XML:
<group id="4" name="invincible player" flags="8" access="0" maxdepotitems="0" maxvipentries="0" />

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local function resetGroup(cid)
    return Player(cid):setGroup(Group(1))
end

local function sendEffects(cid)
    local player = Player(cid)
    if not player then
        return
    end
    if player:getGroup():getId() == 4 then
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        addEvent(sendEffects, 1000, cid)
    end
end

function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    addEvent(resetGroup, 5000, player:getId())
    sendEffects(player:getId())
    return combat:execute(creature, variant)
end

still not working :c the effect doesnt appears no errors on console
 
still not working :c the effect doesnt appears no errors on console
i completely forgot to even set the group lol
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local function resetGroup(cid)
    local player = Player(cid)
    if not player then
        return
    end
    player:setGroup(Group(1))
end

local function sendEffects(cid)
    local player = Player(cid)
    if not player then
        return
    end
    if player:getGroup():getId() == 4 then
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        addEvent(sendEffects, 1000, cid)
    end
end

function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    player:setGroup(Group(4))
    addEvent(resetGroup, 5000, player:getId())
    sendEffects(player:getId())
    return combat:execute(creature, variant)
end
 
Status
Not open for further replies.

Similar threads

Back
Top