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

Script create corpse to position?

FenX

Advanced OT User
Joined
Jul 8, 2019
Messages
360
Solutions
1
Reaction score
160
Hi,

Example:
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)

        local text = ""
        local Config = {
             Coin = {
                Chance = 15
            },
        }
    }
      
        if math.random(100) <= Config.Coin.Chance then
            text = 'You find gold coins.'
            player:addItem(2148, math.random(1, 7))
        else
            text = 'You find nothing'
        end
      
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, text)
        toPosition:sendMagicEffect(3)
    return true
end

How would I add a line so that on use a corpse of id xxxx is created toPosition? Is that possible?

Many thanks in advance <3!
 
@Delusion One more question regarding toPosition

When using toPosition the corpse is created inside the wall. How do I change it so that the corpse is created on player position instead?
 
I'm not sure how to apply it 🤦‍♀️

Care to explain? Don't write it for me but explain so I know wth I'm doing Lol.
 
You just replace toPosition with either one of those, if you want it to be on top of the corpse, use target:getPosition() otherwise if you want it on the player, use player:getPosition().
 
Back
Top