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

CreatureEvent Cast on Login

zerghel

Tsuni
Joined
Jul 1, 2008
Messages
299
Reaction score
9
hello dying community
i want to share a simple AUTOCAST script
i have to say im not a scripter myself, so if anyone can make an improvement to this, feel free to do it
Code:
local autoCastLevel = 1

function onLogin(cid)
    local player = Player(cid)
    if player:getLevel() >= autoCastLevel then
        for i = 1, 8 do
            if not player:getGroup(i):getAccess(i) then
                player:startLiveCast(i, 1)
            end
        end

        -- player:sendTextMessage(MESSAGE_EVENT_ADVANCE,'You have started casting you gameplay')
        player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
    end
    return true
end
you can notice is made using Blessings Script as a base (sorry :p)
 
Lua:
local autoCastLevel = 1
function onLogin(cid)
    local player = Player(cid)
    if player:getGroup():getAccess() then
        return true
    end
    if player:getLevel() >= autoCastLevel then
        if player:startLiveCast() then
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You have started casting your gameplay.")
            player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
        end
    end
    return true
end
 
I realised onLogin uses onLogin(player) on my OT.
Can't edit previous post.

Lua:
local autoCastLevel = 1
function onLogin(player)
    if player:getGroup():getAccess() then
        return true
    end
    if player:getLevel() >= autoCastLevel then
        if player:startLiveCast() then
            player:sendTextMessage(MESSAGE_INFO_DESCR, "You have started casting your gameplay.")
            player:getPosition():sendMagicEffect(CONST_ME_HOLYDAMAGE)
        end
    end
    return true
end
 
Back
Top