samuel157
/root
- Joined
- Mar 19, 2010
- Messages
- 518
- Solutions
- 3
- Reaction score
- 71
- Location
- São Paulo, Brazil
- GitHub
- Samuel10M
Code:
function onSay(player, message, channel)
-- Check if the player has 300 resets in storage 59976
local resets = getPlayerStorageValue(player, 59976)
if resets == -1 or resets < 300 then
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "You need 300 resets to use this command!")
return true
end
-- Make sure the player has a valid target
local target = getCreatureTarget(player)
if target and isCreature(target) then
-- Apply massive damage to the target to ensure death
doCreatureAddHealth(target, -1000000000) -- Intentionally absurd damage value
-- Send a message indicating the target was killed
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "You dealt massive damage to the target, killing it!")
else
-- If there is no valid target
doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "No valid target found.")
end
return true
end
EXAMPLE
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0},
EFFECT CONST_ME_MAGIC_GREEN = 14