Skip to content

Instantly share code, notes, and snippets.

@PrivateDonut
Last active February 1, 2023 04:34
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/c910ab86048380f81df499870b6776ee to your computer and use it in GitHub Desktop.
Save PrivateDonut/c910ab86048380f81df499870b6776ee to your computer and use it in GitHub Desktop.
[Eluna] VIP Commands
--[[
-- Script Name : VIP Commands
-- Made By : PrivateDonut
-- Version : 1.0
-- Description : This script allows you to add VIP commands to your server.
]] --
local vipCooldown = 10 -- Cooldown in seconds for VIP commands
-- Manage VIP Commands
-- true = Turned on, false = turned off
local vip = true
local vipBuffs = true
local vipWhisperOn = true
local vipWhisperOff = true
local vipMall = true
local vipChangeFaction = true
local vipChangeRace = true
local vipChangeName = true
-- Manage VIP Commands Privilege
-- You do not need to edit this if you only have one VIP rank
-- Can set access to each command based on your needs, uses account_access in the auth table.
local vipPrivilege = 1
local vipBuffPrivilege = 1
local vipWhisperOnPrivilege = 1
local vipWhisperOffPrivilege = 1
local vipMallPrivilege = 1
local vipChangeFactionPrivilege = 1
local vipChangeRacePrivilege = 1
local vipChangeNamePrivilege = 1
-- Manage Mall Cords
local vipMallX = 16223.379883 -- X Cord
local vipMallY = 16249.170898 -- Y Cord
local vipMallZ = 12.231200 -- Z Cord
local vipMallO = 1.357899 -- O Cord
local vipMallMap = 1 -- Map ID
-- VIP Buffs
-- You can add as many buffs here as you'd like, just seperate them with a comma. The last entry doesn't need a comma.
local vipBuff = {
35912,
65075
}
-- Do not edit below this line unless you know what you're doing
local cooldowns = {}
local buff = {}
function commandCooldown(player, command, cooldownTime)
-- Check if the player is on cooldown
if (cooldowns[player:GetGUIDLow() .. command] ~= nil) then
local currentTime = os.time()
if (currentTime < cooldowns[player:GetGUIDLow() .. command]) then
player:SendBroadcastMessage("You must wait " .. cooldowns[player:GetGUIDLow() .. command] - currentTime .." seconds before using this command again.")
return false
end
end
cooldowns[player:GetGUIDLow() .. command] = os.time() + cooldownTime
return true
end
function OnChatMessage(event, player, command, type, language)
local rank = player:GetGMRank()
if command == "vip" then
if rank >= vipPrivilege then
if vip == true then
if commandCooldown(player, command, vipCooldown) then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r ~~ VIP Commands List ~~")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip - Shows this list")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip mall - Teleport to the VIP Mall!")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip buff - Buff yourself")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip whisper on - turn whisper on")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip whisper off - turn whisper off")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip changefaction - Change your faction")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip changerace - Change your race")
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r .vip changename - Change your name")
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|rThe VIP command is disabled.")
end
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
if command == "vip mall" then
if rank >= vipMallPrivilege then
if vipMall == true then
if commandCooldown(player, command, vipCooldown) then
-- Check if player is in combat
if player:IsInCombat() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
return false
end
-- Check if player is dead
if player:IsDead() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
return false
end
-- Check if player is in a vehicle
if player:IsOnVehicle() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in a vehicle!")
return false
end
player:Teleport(vipMallMap, vipMallX, vipMallY, vipMallZ, vipMallO)
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You are now being teleported to the VIP mall!")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP Mall command is disabled.")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
if command == "vip buff" then
if rank >= vipBuffPrivilege then
if vipBuffs == true then
if commandCooldown(player, command, vipCooldown) then
-- Check if player is in combat
if player:IsInCombat() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
return false
end
-- Check if player is dead
if player:IsDead() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
return false
end
-- Check if player is in a vehicle
if player:IsOnVehicle() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in a vehicle!")
return false
end
for i = 1, #vipBuff do
player:AddAura(vipBuff[i], player)
end
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You have been buffed!")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP Buff command is disabled.")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
if command == "vip whisper on" then
if rank >= vipWhisperOnPrivilege then
if vipWhisperOn == true then
if commandCooldown(player, command, vipCooldown) then
-- Check if player is in combat
if player:IsInCombat() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
return false
end
-- Check if player is dead
if player:IsDead() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
return false
end
player:SetAcceptWhispers()
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You have turned whispers back on")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP whisper on command is disabled.")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
if command == "vip whisper off" then
if rank >= vipWhisperOnPrivilege then
if vipWhisperOff == true then
if commandCooldown(player, command, vipCooldown) then
-- Check if player is in combat
if player:IsInCombat() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
return false
end
-- Check if player is dead
if player:IsDead() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
return false
end
player:SetAcceptWhispers(false)
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You have turned whisper off!")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP whisper off command is disabled.")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
if command == "vip changefaction" then
if rank >= vipChangeFactionPrivilege then
if vipChangeFaction == true then
if commandCooldown(player, command, vipCooldown) then
-- Check if player is in combat
if player:IsInCombat() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
return false
end
-- Check if player is dead
if player:IsDead() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
return false
end
-- Check if player is in a vehicle
if player:IsOnVehicle() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in a vehicle!")
return false
end
player:SetAtLoginFlag(64)
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You will be able to change your faction on your next login!")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP change faction command is disabled.")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
if command == "vip changerace" then
if rank >= vipChangeRacePrivilege then
if vipChangeRace == true then
if commandCooldown(player, command, vipCooldown) then
-- check if player is in combat
if player:IsInCombat() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
return false
end
-- check if player is dead
if player:IsDead() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
return false
end
player:SetAtLoginFlag(128)
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You will be able to change your race on your next login!")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP whisper on command is disabled.")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
if command == "vip changename" then
if rank >= vipChangeNamePrivilege then
if vipChangeName == true then
if commandCooldown(player, command, vipCooldown) then
-- check if player is in combat
if player:IsInCombat() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while in combat!")
return false
end
-- check if player is dead
if player:IsDead() then
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You cannot use this command while dead!")
return false
end
player:SetAtLoginFlag(1)
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You will be able to change your name on your next login!")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r The VIP change name command is disabled.")
end
else
player:SendBroadcastMessage("|cFFFF0000[VIP System]|r You do not have permission to use this command.")
end
end
end
local function DeleteChat(event, player, command)
if (command:find("vip")) then
return false
end
end
RegisterPlayerEvent(42, OnChatMessage)
RegisterPlayerEvent(42, DeleteChat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment