• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Item for fun

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
than you use item it makes all around people look like demon and player itself for 1 minute , with cooldown

i got an example script here


Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.check(cid, 50268) then
        return true and doPlayerSendCancel(cid, "You are Still Exhausted.Time Left :"..exhaustion.get(cid,50268).." Seconds.") and doSendMagicEffect(getThingPos(cid),CONST_ME_POFF)
    end
    
    if isPlayer(cid) then
    local players_around = getSpectators(getThingPos(cid), 3, 3)
    local players_around2 = getSpectators(getThingPos(cid), 6, 6)
        if #players_around >= 1 then
            exhaustion.set(cid, 50268,120)
            for i = 1,#players_around do
                if isPlayer(players_around[i]) then
                    doCreatureSay(players_around[i], ""..(cid == players_around[i] and "!DEMON POWER" or "!DEMON!").."",TALKTYPE_ORANGE_1)
                end
            end
            for i = 1,#players_around2 do
                if isPlayer(itemEx.uid) then
    local tmp = getCreatureOutfit(cid)
    local tmp2 = getCreatureOutfit(cid)
        tmp.lookType = 123
        doSetCreatureOutfit(itemEx.uid, tmp, 15*1000)
        doSendAnimatedText(toPosition,"D E M O N",25)
        doSendMagicEffect(toPosition,CONST_ME_SLEEP)
                end
            end
        end
    end
    return true
end

--                    doSendMagicEffect(getThingPos(players_around[i]), CONST_ME_HEARTS)

thanks in advance :)
 
If you are looking for something about OT go here --> otland.net
Where are you from? WTFFFF


@Lbtg becouse this is support forum, I decided to rewrite and upgrade your script. I removed some logic mistakes and added easy configuration options. Hope you like this. All for the fun!
Code:
local cfg = {
    range = 5,
    lookTypes = {123, 123} -- you can add multiple looktypes here, it will be chosen at random
    sameLookAtATime = "yes", -- all player will have the same look at a time?
    newLookTime = 15, -- in seconds for how long it will have players looktype
    exhaustID = 50268, -- use free unique storage id
    exhaustTime = 120, -- cooldown in seconds
    funMessages = {"DEMON POWER!", "DEMON!", "Where is my rabbit?", "You are Global Elite? HAHAHA, I\'m pro, I\'m Cake3!"},
    msgType = TALKTYPE_ORANGE_1
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.check(cid, cfg.exhaustID) then
        doPlayerSendCancel(cid, "You are Still Exhausted. Time left : "..exhaustion.get(cid,50268).." seconds.")
        doSendMagicEffect(getThingPos(cid),CONST_ME_POFF)
        return true
    end
 
    local r = math.random(1, #cfg.lookTypes)
    local targets = getSpectators(getThingPos(cid), cfg.range, cfg.range)
    if targets ~= nil and #targets > 0 then
        exhaustion.set(cid, cfg.exhaustID, cfg.exhaustTime)
        for i = 1, #targets do
            if isPlayer(targets[i]) == true then
                doCreatureSay(targets[i], cfg.funMessages[math.random(1,#cfg.funMessages)], cfg.msgType)
                if cfg.sameLookAtATime ~= "yes" then
                    r = math.random(1, #cfg.lookTypes)
                end
                doSetCreatureOutfit(targets[i], {lookType = cfg.LookTypes[r]}, cfg.newLookTime)
                doSendMagicEffect(getCreaturePosition(targets[i]), CONST_ME_SLEEP)
            end
        end
    end
    return true
end
 
Last edited:
Thanks both of you :)
mate i live in otland for last 6-7 years i think i watched and saw most of it ;) but anyway thanks alot

Will test script soon away i back on pc !
 
If you are looking for something about OT go here --> otland.net
Where are you from? WTFFFF


@Lbtg becouse this is support forum, I decided to rewrite and upgrade your script. I removed some logic mistakes and added easy configuration options. Hope you like this. All for the fun!
Code:
local cfg = {
    range = 5,
    lookTypes = {123, 123} -- you can add multiple looktypes here, it will be chosen at random
    sameLookAtATime = "yes", -- all player will have the same look at a time?
    newLookTime = 15, -- in seconds for how long it will have players looktype
    exhaustID = 50268, -- use free unique storage id
    exhaustTime = 120, -- cooldown in seconds
    funMessages = {"DEMON POWER!", "DEMON!", "Where is my rabbit?", "You are Global Elite? HAHAHA, I\'m pro, I\'m Cake3!"},
    msgType = TALKTYPE_ORANGE_1
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if exhaustion.check(cid, cfg.exhaustID) then
        doPlayerSendCancel(cid, "You are Still Exhausted. Time left : "..exhaustion.get(cid,50268).." seconds.")
        doSendMagicEffect(getThingPos(cid),CONST_ME_POFF)
        return true
    end
 
    local r = math.random(1, #cfg.lookTypes)
    local targets = getSpectators(getThingPos(cid), cfg.range, cfg.range)
    if targets ~= nil and targets > 0 then
        exhaustion.set(cid, cfg.exhaustID, cfg.exhaustTime)
        for i = 1, #targets do
            if isPlayer(targets[i]) == true do
                doCreatureSay(targets[i], cfg.funMessages[math.random(1,#cfg.funMessages)], TALKTYPE_ORANGE_1)
                if cfg.sameLookAtATime ~= "yes" then
                    r = math.random(1, #cfg.lookTypes)
                end
                doSetCreatureOutfit(targets[i], {lookType = cfg.LookTypes[r]}, cfg.newLookTime)
                doSendMagicEffect(getCreaturePosition(targets[i]), CONST_ME_SLEEP)
            end
        end
    end
    return true
end
Code:
[19:0:11.258] [Error - LuaInterface::loadFile] data/actions/scripts/demonsoul.lua:24: 'then' expected near 'do'
[19:0:11.258] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/demonsoul.lua)
[19:0:11.258] data/actions/scripts/demonsoul.lua:24: 'then' expected near 'do'
error :( fixed one problem with missing , but cant figure out whats wrong now or see it i mmean
 
Code:
if isPlayer(targets[i]) == true do
to:
Code:
if isPlayer(targets[i]) == true then
Code:
[19:44:40.329] [Error - Action Interface]
[19:44:40.329] data/actions/scripts/demonsoul.lua:onUse
[19:44:40.329] Description:
[19:44:40.329] data/actions/scripts/demonsoul.lua:21: attempt to compare number with table
[19:44:40.329] stack traceback:
[19:44:40.329]  data/actions/scripts/demonsoul.lua:21: in function <data/actions/scripts/demonsoul.lua:12>
after i did that i get this on click
 
Code:
if targets ~= nil and targets > 0 then
To:
Code:
if targets ~= nil and #targets > 0 then
[22:51:49.812] [Error - Action Interface]
[22:51:49.812] data/actions/scripts/demonsoul.lua:onUse
[22:51:49.812] Description:
[22:51:49.812] data/actions/scripts/demonsoul.lua:29: attempt to index field 'LookTypes' (a nil value)
[22:51:49.812] stack traceback:
[22:51:49.812] data/actions/scripts/demonsoul.lua:29: in function <data/actions/scripts/demonsoul.lua:12>
another error :(
 
Back
Top