1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 19:57:46 +00:00
project-meteor-server/data/scripts/commands/gm/setmaxmp.lua
2017-10-10 13:32:47 -05:00

33 lines
No EOL
777 B
Lua

require("global");
properties = {
permissions = 0,
parameters = "sss",
description =
[[
Sets player or <targetname>'s maximum hp to <hp> and heals them to full.
!setmaxhp <hp> |
!setmaxhp <hp> <targetname>
]],
}
function onTrigger(player, argc, hp, name, lastName)
local sender = "[setmaxhp] ";
if name then
if lastName then
player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
else
player = GetWorldManager():GetPCInWorld(name) or nil;
end;
end;
if player then
hp = tonumber(hp) or 1;
location = INVENTORY_CURRENCY;
player:hpstuff(hp);
else
print(sender.."unable to add experience, ensure player name is valid.");
end;
end;