Modcraft - The community dedicated to quality WoW modding!

Community => Showoff - what you are working on => Topic started by: Kian on March 12, 2010, 08:27:10 pm

Title: Player Chat Revive Script
Post by: Kian on March 12, 2010, 08:27:10 pm
Hey I wanted to show you this revive script. You have to write #revive in chat, and you get revived.

Code: [Select]
local messagee = "#revive"

function revive_function(event, player, message, type, language)
if (message == messagee) then
if (player:IsDead() == true) then
player:SendBroadcastMessage("You got revived")
player:FullCastSpell(32343)
player:ResurrectPlayer(player)

elseif (player:IsDead() == false) then

player:SendBroadcastMessage("You are not dead!")

else

return
end
end
end

RegisterServerHook(16, "revive_function")

This script will only check if the player is dead or not. But this will only check is he is dead.

Code: [Select]
local messagee = "#revive"

function revive_function(event, player, message, type, language)
if (message == messagee) then
if (player:IsDead() == true) then
player:SendBroadcastMessage("You got revived!")
player:FullCastSpell(32343)
player:ResurrectPlayer(player)

else
player:SendBroadcastMessage("You are not dead!")
end
end
end

RegisterServerHook(16, "revive_function")

Have fun
Title: Re: Player Chat Revive Script
Post by: schlumpf on May 13, 2010, 12:20:28 pm
A  boolean value can only have two values: true or false. The first piece is just the same as the second one.
Title: Re: Player Chat Revive Script
Post by: Kian on May 13, 2010, 03:49:09 pm
I know it schlumpf.