Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local players = {}
- local welcome_back = {}
- function OnSpawn(pUnit, Event)
- pUnit:RegisterEvent("CheckForPlayers", 2000, 0)
- end
- function CheckForPlayers(pUnit)
- for place,plr in pairs(pUnit:GetPlayersInRange()) do
- if plr ~= nil then
- if pUnit:GetDistanceYards(plr) < 10 then
- for plce,plrs in pairs(players) do
- if plrs ~= plr:GetName() then
- pUnit:SendChatMessage(12,0,"Welcome To The Alliance Mall "..pPlayer:GetName().."!")
- table.insert(players, plr:GetName())
- else
- for plc, plas in pairs(welcome_back) do
- if plas ~= plr:GetName() then
- pUnit:SendChatMessage(12,0,"Welcome back "..pPlayer:GetName().."!")
- table.insert(welcome_back, plr:GetName())
- end
- end
- end
- end
- end
- end
- end
- end
- RegisterUnitEvent(80051, 18, "OnSpawn")
Advertisement
Add Comment
Please, Sign In to add comment