Created
June 17, 2024 18:59
-
-
Save PrivateDonut/6c78dee870f324ffaf67652a3ba713bd to your computer and use it in GitHub Desktop.
[Eluna] Free for All
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
-- 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