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

Death Broadcast 0.3.6 pls

gabrielbello

New Member
Joined
Sep 29, 2009
Messages
4
Reaction score
0
Help I need this scripts for tfs 0.3.6 if someone can help me agradesco thank you I wait for answers
 
Is that it?
In data/creaturescripts/scripts/deathBroadcasts.lua
Add :
Code:
-- Originally scripted by Colandus
local config = {
        killStorageValue = 3943,
        deathStorageValue = 3944,
        -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
        rewardItem = {
                use = true,
                itemid = 8698,
                minLevel = 100, -- false if you don't want any level req
                text = "This is a gift to |KILLERNAME| [|KILLERLEVEL|] for killing |TARGETNAME| [|TARGETLEVEL|]"
        },
        
        killMessage = {
                use = true,
                text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
                messageClass = MESSAGE_STATUS_CONSOLE_BLUE
        },
               broadcastMessage = {
                use = true,
                text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [|TARGETLEVEL|]!",
                messageClass = MESSAGE_STATUS_WARNING
        },
               killerAnimation = {
                use = true,
                text = "Frag!", -- Only 9 letters! No "commands" here.
                color = 215
        },
               targetAnimation = {
                use = true,
                text = "Owned!", -- Only 9 letters! No "commands" here.
                color = 215
        }
}
function onDeath(cid, corpse, killer)
        if(isPlayer(killer) == TRUE) then
                local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
                local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
                
                local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
                local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
                
                setPlayerStorageValue(killer, config.killStorageValue, targetKills)
                setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
               
                local values = {
                        ["KILLERKILLS"]         = killerKills,
                        ["KILLERDEATHS"]        = killerDeaths,
                        ["KILLERNAME"]          = getCreatureName(killer),
                        ["KILLERLEVEL"]         = getPlayerLevel(killer),
                       
                        ["TARGETKILLS"]         = targetKills,
                        ["TARGETDEATHS"]        = targetDeaths,
                        ["TARGETNAME"]          = getCreatureName(cid),
                        ["TARGETLEVEL"]         = getPlayerLevel(cid)
                }
                function formateString(str)
                        return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
                end
               
                if(config.rewardItem.use and (not config.rewardItem.level or getPlayerLevel(cid) >= config.rewardItem.level)) then
                        local uid = doPlayerAddItem(killer, config.rewardItem.itemid)
                        doSetItemSpecialDescription(uid, formateString(config.rewardItem.text))
                end
                if(config.killMessage.use) then
                        doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
                end
                if(config.broadcastMessage.use) then
                        broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)
                end
                if(config.killerAnimation.use) then
                        doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
                end
                if(config.targetAnimation.use) then
                        doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
                end
        end
               return TRUE
end
Now in your login.lua add:
PHP:
registerCreatureEvent(cid, "DeathBroadcast")
In data/creaturescripts/creaturescripts.xml
add:
PHP:
<event type="death" name="DeathBroadcast" script="deathBroadcast.lua"/>

Orginially scripted by Colandus dont rep me, rep him ;)
 
[15/02/2010 04:32:20] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/deathBroadcast.lua:67: ')' expected near 'sage'
[15/02/2010 04:32:20] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/deathBroadcast.lua)
[15/02/2010 04:32:20] data/creaturescripts/scripts/deathBroadcast.lua:67: ')' expected near 'sage'



A mistake goes out
 
Alrite gimme a few minutes ill fix this for you.

Can you try this:
Code:
local config = {
        killStorageValue = 3943,
        deathStorageValue = 3944,
        -- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME
        rewardItem = {
                use = true,
                itemid = 8698,
                minLevel = 100, -- false if you don't want any level req
                text = "This is a gift to |KILLERNAME| [|KILLERLEVEL|] for killing |TARGETNAME| [|TARGETLEVEL|]"
        },
        
        killMessage = {
                use = true,
                text = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",
                messageClass = MESSAGE_STATUS_CONSOLE_BLUE
        },
               broadcastMessage = {
                use = true,
                text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [|TARGETLEVEL|]!",
                messageClass = MESSAGE_STATUS_WARNING
        },
               killerAnimation = {
                use = true,
                text = "Frag!", -- Only 9 letters! No "commands" here.
                color = 215
        },
               targetAnimation = {
                use = true,
                text = "Owned!", -- Only 9 letters! No "commands" here.
                color = 215
        }
}
function onDeath(cid, corpse, killer)
        if(isPlayer(killer) == TRUE) then
                local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1
                local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1
                
                local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1
                local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1
                
                setPlayerStorageValue(killer, config.killStorageValue, targetKills)
                setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)
               
                local values = {
                        ["KILLERKILLS"]         = killerKills,
                        ["KILLERDEATHS"]        = killerDeaths,
                        ["KILLERNAME"]          = getCreatureName(killer),
                        ["KILLERLEVEL"]         = getPlayerLevel(killer),
                       
                        ["TARGETKILLS"]         = targetKills,
                        ["TARGETDEATHS"]        = targetDeaths,
                        ["TARGETNAME"]          = getCreatureName(cid),
                        ["TARGETLEVEL"]         = getPlayerLevel(cid)
                }
                function formateString(str)
                        return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))
                end
               
                if(config.rewardItem.use and (not config.rewardItem.level or getPlayerLevel(cid) >= config.rewardItem.level)) then
                        local uid = doPlayerAddItem(killer, config.rewardItem.itemid)
                        doSetItemSpecialDescription(uid, formateString(config.rewardItem.text))
                end
                if(config.killMessage.use) then
                        doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))
                end
                if(config.broadcastMessage.use) then
                        broadcastMessage(formateString(config.broadcastMessage.text), (config.broadcastMessage.messageClass))
                end
                if(config.killerAnimation.use) then
                        doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)
                end
                if(config.targetAnimation.use) then
                        doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)
                end
        end
               return TRUE
end
 
Last edited:
Already it(he,she) does not give me the mistake but now the red text does not go out saying q player bushes to other one it(he,she) does not even give bony(osseous) items the scrips gives neither mistake nor anything but not this fusionando
 
Back
Top