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

Breakchance and MSG(player:say)?

Svira

Active Member
Joined
Jan 27, 2008
Messages
268
Solutions
11
Reaction score
36
Hello everyone very warmly! Question to the community, how do I set the message to be sent when the brackchance function is called? I am using tfs1.5 and canary, please help me, my result was to add script/weapons to the registry:

Lua:
slingShot:breakChance(9, function(player) player:say("Your magical Slingshot dissolved into the mist.", TALKTYPE_MONSTER_SAY) end)

the message is not sent and I have no errors in the console.
 
Solution
No such thing. You will need sources edits, prefarably new event that will fire when item breaks, with the player and item as parameters.
I see that it's more of a challenge, I took a shortcut and using the remove function I calculate the odds of disappearing.

now i have a guess how in the following code to mark item to be removed from hand, left or right?

Lua:
local removeChance = math.random(1, 100)
    if removeChance <= 9 then
        player:removeItem(5907, 1)
        player:say("Your magical Slingshot dissolved into the mist.", TALKTYPE_MONSTER_SAY)
    end
Lua:
slingShot:breakChance(9, function(player) player:say("Your magical Slingshot dissolved into the mist.", TALKTYPE_MONSTER_SAY) end)
No such thing. You will need sources edits, prefarably new event that will fire when item breaks, with the player and item as parameters.
 
No such thing. You will need sources edits, prefarably new event that will fire when item breaks, with the player and item as parameters.
I see that it's more of a challenge, I took a shortcut and using the remove function I calculate the odds of disappearing.

now i have a guess how in the following code to mark item to be removed from hand, left or right?

Lua:
local removeChance = math.random(1, 100)
    if removeChance <= 9 then
        player:removeItem(5907, 1)
        player:say("Your magical Slingshot dissolved into the mist.", TALKTYPE_MONSTER_SAY)
    end
 
Solution
Back
Top