[Lua] Player Commands

Go down

[Lua] Player Commands

Post  Blachex on Wed Jul 14, 2010 6:22 pm

What you can do with this one, commands:

1. Repair - Will summ Repair Bot for 5 mins.
2. Buffs - You will gain buffs. (Mainly buffs from scrolls)
3. Turbo - Will allow you to use sprint for few sec. (5 mins cd)
4. Food - Will add you food. (With well feed)
5. Battle - Will add few battle elixirs.
6. Guardian - Will add few guardian elixirs.

Script:

function OnChat(event, player, message, type, language)
if (message == Repair_Bot) then
local x = player:GetX()
local y = player:GetY()
local z = player:GetZ()
local o = player:GetO()
player:SpawnCreature(24780, x, y+2, z, o, 35, 300000)
player:SendAreaTriggerMessage("You have spawned Your Repair Bot successfully!")
return 0
end

if (message == Buff_Up) then
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You cannot Buff Up while in Combat!")
else
if (player:IsDead() == true) then
player:SendAreaTriggerMessage("You cannot Buff Up while You are Dead!")
else
player:CastSpellOnTarget(43466, player)
player:CastSpellOnTarget(43464, player)
player:CastSpellOnTarget(37092, player)
player:CastSpellOnTarget(37098, player)
player:CastSpellOnTarget(37094, player)
player:CastSpellOnTarget(43467, player)
player:SendAreaTriggerMessage("You have been buffed with success!")
return 0
end
end


if (message == Turbo_On) then
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You cannot use "Turbo" while in Combat!")
else
if (player:IsDead() == true) then
player:SendAreaTriggerMessage("You cannot use "Turbo" while You are Dead!")
else
player:CastSpellOnTarget(47, player)
player:SendAreaTriggerMessage("System online. Turbo mode activated!")
return 0
end
end



if (message == Food_On) then
Item:AddLoot(34762,20,20,ffa_loot)
Item:AddLoot(34767,20,20,ffa_loot)
player:SendAreaTriggerMessage("Food has been added with success!")
end

if (message == Battle_Elixir) then
Item:AddLoot(44330,20,20,ffa_loot)
Item:AddLoot(44327,20,20,ffa_loot)
Item:AddLoot(44329,20,20,ffa_loot)
Item:AddLoot(44331,20,20,ffa_loot)
player:SendAreaTriggerMessage("Battle Elixir's has been added with success!")
end


if (message == Guardian_Elixir) then
Item:AddLoot(32068,20,20,ffa_loot)
Item:AddLoot(22848,20,20,ffa_loot)
player:SendAreaTriggerMessage("Guardian Elixir's has been added with success!")
end
end

RegisterServerHook(16, "OnChat")

No credits to me.I posted this not for +rep but because I see it helpfully for your server.

_________________
[You must be registered and logged in to see this link.] | [You must be registered and logged in to see this link.] | [You must be registered and logged in to see this link.] | [You must be registered and logged in to see this link.]
avatar
Blachex
TwistGaming Admin
TwistGaming Admin

Posts Posts : 375
Location Location : Romania
Reputation Reputation : 38
Warning :

http://www.twistgaming.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum