Shawak
Intermediate OT User
Here a script, that kills player .
It's for TFS 0.3.4.
data/talkaction/scripts/kill.lua
data/talkactions/talkactions.xml
Command:
!kill ...
(... = playername)
Screenshot:
17:08 You are dead.
After saying !kill ..., the player have 5 sec,.. you can change that here:
Just change 5 to 6, 7, or something else.
I hope you like it :thumbup:.
And if you liked it, please don't forget to Rep++ me .
Regards,
Shawak
It's for TFS 0.3.4.
data/talkaction/scripts/kill.lua
Lua:
local config = {
--[[
Fun Script Kill v1.0
by Maxi (Shawak)
]]--
-- CONFIG --------------------------------------------------
timeToDie = 5 -- after this seconds, the player die
-- CONFIG END ----------------------------------------------
} -- Don't touch ----------------
local z = config.timeToDie
local events = {}
local fight = createConditionObject(CONDITION_INFIGHT, (config.timeToDie*1000+100))
-------------------------------
function onSay(cid, words, param, channel)
local player = getPlayerByNameWildcard(param)
local message = ""..getCreatureName(cid).." decided to kill you in ..."
if (player ~= nil) and (isPlayer(cid) == TRUE) then
if getPlayerGroupId(player) == 1 then
doAddCondition(player, fight)
events = addEvent(text,100,{cid = cid, player = player})
doPlayerSendTextMessage(player,18,message)
else
doPlayerSendTextMessage(cid,18,"You can only kill players.")
end
else
doPlayerSendTextMessage(cid,18,"Player not found.")
end
return TRUE
end
function text(parameters)
local cid = parameters.cid
local player = parameters.player
if (getPlayerLevel(player) ~= FALSE) then
if z >= 1 then
doPlayerSendTextMessage(player,18,""..z.."")
events = addEvent(text,1000,{cid = cid, player = player})
z = z-1
elseif z == 0 then
z = config.timeToDie
events = nil
doCreatureAddHealth(player,-getCreatureHealth(player))
doPlayerSendTextMessage(cid,18,"You killed "..getCreatureName(player)..".")
end
end
return TRUE
end
data/talkactions/talkactions.xml
HTML:
<talkaction words="/kill" event="script" value="kill.lua"/>
Command:
!kill ...
(... = playername)
Screenshot:
17:08 You are dead.
After saying !kill ..., the player have 5 sec,.. you can change that here:
Lua:
timeToDie = 5
I hope you like it :thumbup:.
And if you liked it, please don't forget to Rep++ me .
Regards,
Shawak
Last edited: