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

Client crash when monster dies (Size-Length)

Joriku

Working in the mines, need something?
Premium User
Joined
Jul 16, 2016
Messages
1,141
Solutions
15
Reaction score
432
Location
Sweden
Client crashes afther killing a monster, any clues why?
(No console errors/ no loggs)
Error msg on client (using 10.100) Updated .spr and .dat files still crashing for some reason
Using war config if that might be the issue
using this: [10.77+ - TFS 1.2] The Forgotten [WAR] Server v1.1 (UPDATED 17/12/15) (https://otland.net/threads/10-77-tfs-1-2-the-forgotten-war-server-v1-1-updated-17-12-15.234453/)
2b429231505d7a247fff8699f93d8cf0.png
 
Solution
Using myself of OTServBR which should be pointed at TFS 1.3

I mixed a bit with a FragReward script which sends out a msg when the player dies
Script:
Changed a code into Game.broadcastMessage
LUA:
-- ver. 1.1 2011-12-09
-- author tfs, otland.net/members/andypsylon
local c = {
item = 2160, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 2},
{"Owned!", 18, 3},
{"Pwnt!", 215, 4}
}
}
function onKill(cid, target)
if not target:isPlayer() then
cid:say("debug: target wasnt a player", 0) -- you can remove this line after you check it's working, but if your char...
It looks like an error with a missing chat type param for Creature.say (ChatMessageMode = 0), are you sending a message when a monster dies?
 
What TFS version are you using?
Using myself of OTServBR which should be pointed at TFS 1.3
It looks like an error with a missing chat type param for Creature.say (ChatMessageMode = 0), are you sending a message when a monster dies?
I mixed a bit with a FragReward script which sends out a msg when the player dies
Script:
Changed a code into Game.broadcastMessage
LUA:
-- ver. 1.1 2011-12-09
-- author tfs, otland.net/members/andypsylon
local c = {
item = 2160, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 2},
{"Owned!", 18, 3},
{"Pwnt!", 215, 4}
}
}
function onKill(cid, target)
if not target:isPlayer() then
cid:say("debug: target wasnt a player", 0) -- you can remove this line after you check it's working, but if your char starts spamming this, then bug may be becouse you use it in onKill instead of onPrepareDeath.
return true
end

local getStor = cid:getStorageValue( c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

cid:setStorageValue(c.store, (getStor + 1))
cid:setStorageValue(c.tstore, (cid:getStorageValue(c.tstore) +1))
target:setStorageValue(c.dstore, (cid:getStorageValue(c.dstore) + 1))

target:say(c.table[rand][1], TALKTYPE_MONSTER_YELL)
doPlayerAddItem(cid, 2160, 1)

if(getStor == 5) then
Game.broadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
Game.broadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
Game.broadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
Game.broadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
Game.broadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
 
Using myself of OTServBR which should be pointed at TFS 1.3

I mixed a bit with a FragReward script which sends out a msg when the player dies
Script:
Changed a code into Game.broadcastMessage
LUA:
-- ver. 1.1 2011-12-09
-- author tfs, otland.net/members/andypsylon
local c = {
item = 2160, -- reward itemid
store = 6000, -- storage for Current frags like in login script
tstore = 7000, -- Total Storage value for kills
dstore = 8000, -- Total Storage value for deaths
table = {
{"Smashed!", 189, 1},
{"Dead!", 190, 2},
{"Owned!", 18, 3},
{"Pwnt!", 215, 4}
}
}
function onKill(cid, target)
if not target:isPlayer() then
cid:say("debug: target wasnt a player", 0) -- you can remove this line after you check it's working, but if your char starts spamming this, then bug may be becouse you use it in onKill instead of onPrepareDeath.
return true
end

local getStor = cid:getStorageValue( c.store)
local rand = math.random(1, #c.table)
local name = getCreatureName(cid)

cid:setStorageValue(c.store, (getStor + 1))
cid:setStorageValue(c.tstore, (cid:getStorageValue(c.tstore) +1))
target:setStorageValue(c.dstore, (cid:getStorageValue(c.dstore) + 1))

target:say(c.table[rand][1], TALKTYPE_MONSTER_YELL)
doPlayerAddItem(cid, 2160, 1)

if(getStor == 5) then
Game.broadcastMessage(name .. " is on killing spree! He killed 5 players!")
elseif(getStor == 10) then
Game.broadcastMessage(name .. " is dominating! He killed 10 players!")
elseif(getStor == 25) then
Game.broadcastMessage(name .. " is CRAZY! He killed 25 players!")
elseif(getStor == 50) then
Game.broadcastMessage(name .. " is UNSTOPPABLE!! He killed 50 players! DO SOMETHING!")
elseif(getStor == 100) then
Game.broadcastMessage("Bow down to your new god "..name.." has 100 frags!")
end

return true
end
Remove this line:
LUA:
cid:say("debug: target wasnt a player", 0) -- you can remove this line after you check it's working, but if your char starts spamming this, then bug
 
Solution
Remove this line:
LUA:
cid:say("debug: target wasnt a player", 0) -- you can remove this line after you check it's working, but if your char starts spamming this, then bug
Didn't change it on monsters - testing on player (works like the old code on players) just crashes while killing a mob
this is what I use, might be the type that messes it up?
LUA:
<event type="kill" name="FragReward" script="tfws_creaturescripts/fragreward.lua"/>

Update:
I removed the script so it's no longer in usage. Crash is gone but instead the server crashed
8bdb885f6dd3d2f45fa48d77aa4db14e.png


Update on update?
Restarted the server, works fine. No crashes so the script is messing it up?
 
Last edited:
There's nothing there that should be causing a server crash, the client crash is in the line I sent though, the talktype is 0 which matches up with the crash message.
 
There's nothing there that should be causing a server crash, the client crash is in the line I sent though, the talktype is 0 which matches up with the crash message.
Thank you for helping me solve this <3
Let's see, how to you get a exp system for pvp?
A player kills and gets x exp by not using this in config?
LUA:
experienceByKillingPlayers = true
expFromPlayersLevelRange = 2000
 

Similar threads

Back
Top