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

Scripter LUA scripting service for 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,814
Solutions
585
Reaction score
5,380
I can basically script anything in Lua you want.

- Self-taught Lua through these forums
- Slightly better then mediocre
- You can sometimes expect miracles

PM or message me in this thread.

Provide as much detail as you can about what you want me to do.

If I don't understand exactly what you want, I will ask you multiple multiple questions.
I'm not going to waste my time scripting something you won't use because I didn't do it exactly as you wanted.

Note; I have little to no experience with database or source edits..
So any requests that require either of these I will likely decline almost immediately, unless I know of a work-around that can be used in place of whatever you are trying to do.

Cheers,

Xikini
 
I can basically script anything in Lua you want.

- Self-taught Lua through these forums
- Slightly better then mediocre
- You can sometimes expect miracles

PM or message me in this thread.

Provide as much detail as you can about what you want me to do.

If I don't understand exactly what you want, I will ask you multiple multiple questions.
I'm not going to waste my time scripting something you won't use because I didn't do it exactly as you wanted.

Note; I have little to no experience with database or source edits..
So any requests that require either of these I will likely decline almost immediately, unless I know of a work-around that can be used in place of whatever you are trying to do.

Cheers,

Xikini
@Xikini
If you can do this in TFS 1.X also it will be great!
You are really a wonderful and reliable person, I support you
also thanks for helping me dude good lucky!
Best Regards!
 
I can basically script anything in Lua you want.

- Self-taught Lua through these forums
- Slightly better then mediocre
- You can sometimes expect miracles

PM or message me in this thread.

Provide as much detail as you can about what you want me to do.

If I don't understand exactly what you want, I will ask you multiple multiple questions.
I'm not going to waste my time scripting something you won't use because I didn't do it exactly as you wanted.

Note; I have little to no experience with database or source edits..
So any requests that require either of these I will likely decline almost immediately, unless I know of a work-around that can be used in place of whatever you are trying to do.

Cheers,

Xikini


Hey,

im having troubles with the addons.

For example, i have a female character with mage full (that one that you need the winning lottery ticket when you are female.). Then when i !changesex, the male version instead of have the summoner full, is with ferumbras hat and mage wand addon. And vice verse. I would like to fix that.
Can you help me and how much it cost?
 
hello @Xikini
well my script works but it need a missing feature
atm if i pull the lever and the player its standing where the sqm will change (a normal sqm by a hole)
the player stays "floating"when he should had fell down
can someone add this feature please?

Code:
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
    gettile1 = getThingfromPos(tile1)
    if item.actionid == 4016 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(427, 1, tile1) 
        doTransformItem(item.uid, item.itemid+1)
    elseif item.actionid == 4016 and item.itemid == 1946 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(351, 1, tile1)
        doTransformItem(item.uid, item.itemid-1) 
    else
        doPlayerSendCancel(cid, "Sorry, not possible.")
    end
    return true
end

i need to add dorelocate code
to make that if a player pull the lever and another player its standing where the sqm will change this player will fall down 1 floor

could you add this to the code please men?
how much it would cost?

thanks in advance
 
Hey,

im having troubles with the addons.

For example, i have a female character with mage full (that one that you need the winning lottery ticket when you are female.). Then when i !changesex, the male version instead of have the summoner full, is with ferumbras hat and mage wand addon. And vice verse. I would like to fix that.
Can you help me and how much it cost?
Check your PM's for my discord contact information.
hello @Xikini
well my script works but it need a missing feature
atm if i pull the lever and the player its standing where the sqm will change (a normal sqm by a hole)
the player stays "floating"when he should had fell down
can someone add this feature please?

Code:
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
    gettile1 = getThingfromPos(tile1)
    if item.actionid == 4016 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(427, 1, tile1)
        doTransformItem(item.uid, item.itemid+1)
    elseif item.actionid == 4016 and item.itemid == 1946 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(351, 1, tile1)
        doTransformItem(item.uid, item.itemid-1)
    else
        doPlayerSendCancel(cid, "Sorry, not possible.")
    end
    return true
end

i need to add dorelocate code
to make that if a player pull the lever and another player its standing where the sqm will change this player will fall down 1 floor

could you add this to the code please men?
how much it would cost?

thanks in advance
Since the trap door is a floor tile, I'm assuming doRelocate won't move it, but if it does, there are ways to work around that.
I optimized a few other portions of the script while I was at it.

Cheers.
Lua:
local tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
local relocate_position = {x = 1000, y = 1000, z = 7}

function onUse(cid, item, frompos, item2, topos)
    local gettile1 = getThingfromPos(tile1)
    if item.itemid == 1945 then
        doTransformItem(gettile1.uid, 427)
        doRelocate(tile1, relocate_position, true)
    else
        doTransformItem(gettile1.uid, 351)
    end
    doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
    return true
end
 
Check your PM's for my discord contact information.

Since the trap door is a floor tile, I'm assuming doRelocate won't move it, but if it does, there are ways to work around that.
I optimized a few other portions of the script while I was at it.

Cheers.
Lua:
local tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
local relocate_position = {x = 1000, y = 1000, z = 7}

function onUse(cid, item, frompos, item2, topos)
    local gettile1 = getThingfromPos(tile1)
    if item.itemid == 1945 then
        doTransformItem(gettile1.uid, 427)
        doRelocate(tile1, relocate_position, true)
    else
        doTransformItem(gettile1.uid, 351)
    end
    doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
    return true
end
thanks xikini !!! could this dorelocate code to teleportthing? i have to change
this? (tile1, relocate_position, true)
 
thanks xikini !!! could this dorelocate code to teleportthing? i have to change
this? (tile1, relocate_position, true)
relocate teleports players and items. There is no reason not to use dorelocate for this script.
 
Hello dude i got this script but it's not working at otx server tfs 0.3.7
Does anything seem wrong?
Lua:
local config = {
positions = {
["Addons "] = { x = 1000, y = 1000, z = 7 },
["help "] = { x = 1000, y = 999, z = 7 }
},


effects = {
CONDITION_PARAM_DELAYED



}
}

function onThink(cid, interval, lastExecution)
for text, pos in pairs(config.positions) do
doSendMagicEffect(pos, math.random(0, 45))
doSendAnimatedText(pos, text, math.random(1, 100))
end
return TRUE
end
XML:
 <globalevent name="effect" interval="900" event="script" value="effect.lua"/>
 
Hello dude i got this script but it's not working at otx server tfs 0.3.7
Does anything seem wrong?
Lua:
local config = {
positions = {
["Addons "] = { x = 1000, y = 1000, z = 7 },
["help "] = { x = 1000, y = 999, z = 7 }
},


effects = {
CONDITION_PARAM_DELAYED



}
}

function onThink(cid, interval, lastExecution)
for text, pos in pairs(config.positions) do
doSendMagicEffect(pos, math.random(0, 45))
doSendAnimatedText(pos, text, math.random(1, 100))
end
return TRUE
end
XML:
 <globalevent name="effect" interval="900" event="script" value="effect.lua"/>
Lua:
local config = {
    {{x = 1000, y = 1000, z = 7}, "Addons"},
    {{x = 1000, y = 999, z = 7},  "help"}
}

function onThink(cid, interval, lastExecution)
    for i = 1, #config do
        doSendMagicEffect(config[i][1], math.random(0, 45))
        doSendAnimatedText(config[i][1], config[i][2], math.random(1, 100))
    end
    return true
end
 
Lua:
local config = {
    {{x = 1000, y = 1000, z = 7}, "Addons"},
    {{x = 1000, y = 999, z = 7},  "help"}
}

function onThink(cid, interval, lastExecution)
    for i = 1, #config do
        doSendMagicEffect(config[i][1], math.random(0, 45))
        doSendAnimatedText(config[i][1], config[i][2], math.random(1, 100))
    end
    return true
end
not working
edit
it was somewhere else
 
Last edited:
not working
Guess try opening a support thread.
I can't see anything wrong with the code I provided.

Or try recopying it? idk
Maybe you missed some text
Ah, I see you got it working.
That's good. :)
 
Last edited:
Hello xikini after regards, i want to make if you killed somebody some normal effect comes on you with text effect and say OWNED with red
at the same moment you receive a absorb effect like this
Lua:
doSendDistanceShoot({x=getCreaturePosition(cid).x+2,y=getCreaturePosition(cid).y,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x+2,y=getCreaturePosition(cid).y+2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x-2,y=getCreaturePosition(cid).y-2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x-2,y=getCreaturePosition(cid).y,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x-2,y=getCreaturePosition(cid).y+2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x,y=getCreaturePosition(cid).y-2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x,y=getCreaturePosition(cid).y+2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
if it possible to make it will be cool :)
thanks
 
Hello xikini after regards, i want to make if you killed somebody some normal effect comes on you with text effect and say OWNED with red
at the same moment you receive a absorb effect like this
Lua:
doSendDistanceShoot({x=getCreaturePosition(cid).x+2,y=getCreaturePosition(cid).y,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x+2,y=getCreaturePosition(cid).y+2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x-2,y=getCreaturePosition(cid).y-2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x-2,y=getCreaturePosition(cid).y,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x-2,y=getCreaturePosition(cid).y+2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x,y=getCreaturePosition(cid).y-2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
       doSendDistanceShoot({x=getCreaturePosition(cid).x,y=getCreaturePosition(cid).y+2,z=getCreaturePosition(cid).z}, getCreaturePosition(cid), 40)
if it possible to make it will be cool :)
thanks
oh god, don't ever script like that.
7 * 4 = 28 times you call the 'getCreaturePosition' function
Just make 1 local
Lua:
local cid_pos = getCreaturePosition(cid)
I'll send you a completed code in pm.
 
oh god, don't ever script like that.
7 * 4 = 28 times you call the 'getCreaturePosition' function
Just make 1 local
Lua:
local cid_pos = getCreaturePosition(cid)
I'll send you a completed code in pm.
ok :)
 

ah w/e. I'll just post here.

data/creaturescripts/creaturescripts.xml
XML:
<event type="kill" name="player_kill_effect" event="script" value="player_kill_effect.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near bottom with other registered events]
Lua:
registerCreatureEvent(cid, "player_kill_effect")
data/creaturescripts/scripts/player_kill_effect.lua
Lua:
local effects = {{2, -2}, {2, 0}, {2, 2}, {-2, -2}, {-2, 0}, {-2, 2}, {0, -2}, {0, 2}}
local effect = 40

function onKill(cid, target, damage, flags)
    if not isPlayer(target) or isMonster(cid) then
        return true
    end
    local pos = getCreaturePosition(target)
    for i = 1, #effects do
        doSendDistanceShoot({x = pos.x + effects[i][1], y = pos.y + effects[i][2], z = pos.z}, pos, effect)
    end
    doCreatureSay(cid, "OWNED!", TALKTYPE_ORANGE_1)
    return true
end
 
Status
Not open for further replies.
Back
Top