PDA

View Full Version : Announcing NPC



Synthetic
31-08-08, 06:32 AM
This is a simple very easy lua script, that makes and npc that yells to vote for your server, this npc needs to config before u put it into u scripts folder.


Made by Synthetic for MMOPRO < ------------ Delete all this including this!



function npc_OnSpawn(pUnit, event)
pUnit:RegisterEvent("Npc_Yell", 300000, 0)
end

function Npc_Yell(pUnit)
local yell = math.random(1,3)
if(yell == 1) then
pUnit:SendChatMessage(14, 0, "First Text")
end
if(yell == 2) then
pUnit:SendChatMessage(14, 0, "Second Text")
end
if(yell == 3) then
pUnit:SendChatMessage(14, 0, "Third Text")
end
end

RegisterUnitEvent(EntryID, 6, "npc_OnSpawn")

Remember to change the entry id! <----- Delete!
Update, Modified to say 10 Messages, this is really for the big stuff's ;)


function npc_OnSpawn(pUnit, event)
pUnit:RegisterEvent("Npc_Yell", 300000, 0)
end

function Npc_Yell(pUnit)
local yell = math.random(1,3)
if(yell == 1) then
pUnit:SendChatMessage(14, 0, "First Text")
end
if(yell == 2) then
pUnit:SendChatMessage(14, 0, "Second Text")
end
if(yell == 3) then
pUnit:SendChatMessage(14, 0, "Third Text")
end
if(yell == 4) then
pUnit:SendChatMessage(14, 0, "Text Here")
end
if(yell == 5) then
pUnit:SendChatMessage(14, 0, "Text here")
end
if(yell == 6) then
pUnit:SendChatMessage(14, 0, "Text here")
end
if(yell == 7) then
pUnit:SendChatMessage(14, 0, "Text here")
end
if(yell == 8) then
pUnit:SendChatMessage(14, 0, "Third Text")
end
if(yell == 9) then
pUnit:SendChatMessage(14, 0, "Text here")
end
if(yell == 10) then
pUnit:SendChatMessage(14, 0, "Text here")
end
end

RegisterUnitEvent(EntryID, 6, "npc_OnSpawn")

Put this together with the announcing NPC! Else it wont work.

Want teleportation to? here u got it! U need to configure it yourself, u need will need more than normal knowledge to do it, else if u need it specific ask me.

function warp_on_gossip_talk(unit, event, player)
unit:CreateGossipMenuForPlayer(3543, player)
unit:MenuAddItem(player, 0, "Events", 1, 0)
unit:MenuSendToPlayer(player)
end

function warp_on_gossip_select(unit, event, player, id, intid, code)
if(intid == 1) then
unit:CreateGossipMenuForPlayer(3542, player)
unit:MenuAddItem(player, 5, "Event1", 9, 0)
unit:MenuAddItem(player, 5, "Event2", 10, 0)
unit:MenuAddItem(player, 5, "Event3", 11, 0)
unit:MenuAddItem(player, 5, "Event4", 12, 0)
unit:MenuAddItem(player, 5, "[Back]", 100, 0)unit:MenuSendToPlayer(player)
end

f(intid == 9) then
player:Teleport(The Teleportation Direction)
end
if(intid == 10) then
player:Teleport(The Teleportation Direction)
end
if(intid == 11) then
player:Teleport(The Teleportation Direction)
end
if(intid == 12) then
player:Teleport(The Teleportation Direction)
end

end
intid = 0
end


How to use

Config it (Should be easy!)

Put it into scripts folder then restart server.

Enjoy, now u got and announcing npc for you server.

lol
31-08-08, 08:28 AM
Gosh, nice man! i'll love it! I will use it in my server.

Jimmy
02-09-08, 06:07 AM
nice..

Synthetic
02-09-08, 06:19 AM
Thanks for the good words ;)

Coldmrn
05-09-08, 09:39 AM
Please can u compile this for me, i dont have that program to compile the script!

Thanks
+rep if you compile

Synthetic
05-09-08, 01:13 PM
Dude, Download and Lua Compiling program, alot easier. Then i dont have to do the job ;)