Skip to content

Instantly share code, notes, and snippets.

@PrivateDonut
Last active February 4, 2023 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save PrivateDonut/06b93fe9f0b0aff417bf4980453cb64b to your computer and use it in GitHub Desktop.
Save PrivateDonut/06b93fe9f0b0aff417bf4980453cb64b to your computer and use it in GitHub Desktop.
[Eluna] Free for All
--[[
-- Script Name : Free For All
-- Made By : PrivateDonut
-- Description : This script will allow you to create a Free For All zone, where players can attack each other without being flagged for PvP.
]] --
-- Enable/Disable Features
local enableFFA = true -- True/False Free For All
local enableFFAFlag = true -- True/False Free For All Flag
local enablePhase = true -- True/False Phase Mask
local enableGroup = true -- True/False Group Removal
local enableCombat = true -- True/False Combat Check
local enableMessage = true -- True/False Messages
-- Message Settings
local enterFFA = "|cFFFF0000[FFA System]|r You have entered the Free For All zone."
local leaveFFA = "|cFFFF0000[FFA System]|r You have left the Free For All zone."
local combatFFA = "|cFFFF0000[FFA System]|r You cannot leave the FFA zone while in combat!"
-- Define zone IDs you want to be the Free For All
local zone = {
12 -- Elwynn Forest
}
-- If enabled, will port the player back to the FFA Zone.
local FFA_Teleport = {{12, 0, -8949.95, -132.493, 83.5312, 0} -- Elwynn Forest
}
-- Do not edit below this line, unless you know what you're doing.
local function EnterFFA(event, player, newZone, newArea)
if enableFFA == true then
if enableFFAFlag == true then
player:SetFFA(true)
end
if enablePhase == true then
player:SetPhaseMask(2, true)
end
if enableGroup == true then
player:RemoveFromGroup()
end
if enableCombat == true then
if player:IsInCombat() == true then
player:SendBroadcastMessage(combatFFA)
player:Teleport(FFA_Teleport[1][2], FFA_Teleport[1][3], FFA_Teleport[1][4], FFA_Teleport[1][5],
FFA_Teleport[1][6])
end
end
if enableMessage == true then
for i = 1, #zone do
if newZone == zone[i] then
player:SendBroadcastMessage(enterFFA)
end
end
end
for i = 1, #zone do
if newZone ~= zone[i] then
if enableFFAFlag == true then
player:SetFFA(false)
end
if enablePhase == true then
player:SetPhaseMask(1, true)
end
if enableMessage == true then
player:SendBroadcastMessage(leaveFFA)
end
end
end
end
end
RegisterPlayerEvent(27, EnterFFA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment