Register for your free account! | Forgot your password?

Go Back   elitepvpers > World of Warcraft > WoW Addons
You last visited: Today at 12:47

  • Please register to post and access all features, it's quick, easy and FREE!


Need help with lua script

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2018
Posts: 1
Received Thanks: 0
Exclamation Need help with lua script

Hello there,

I need help with a lua script, I would like to add color into PlayerFrame aswell same as TargetFrame and FocusFrame.

In the code below it already have class color in health bar and color behind name of target and focus, not player frame.
(red marked text is the code I tried to implement without any success)


local frame = CreateFrame("FRAME")
frame:RegisterEvent("GROUP_ROSTER_UPDATE")
frame:RegisterEvent("PLAYER_TARGET_CHANGED")
frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
frame:RegisterEvent("PLAYER_FRAME_CHANGED")<- Not sure about this one, tried many different texts.
frame:RegisterEvent("UNIT_FACTION")

local function eventHandler(self, event, ...)
if UnitIsPlayer("target") then
c = RAID_CLASS_COLORS[select(2, UnitClass("target"))]
TargetFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
end
if UnitIsPlayer("focus") then
c = RAID_CLASS_COLORS[select(2, UnitClass("focus"))]
FocusFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
end
if UnitIsPlayer("player") then
c = RAID_CLASS_COLORS[select(2, UnitClass("player"))]
PlayerFrameNameBackground:SetVertexColor(c.r, c.g, c.b)

end
end

frame:SetScript("OnEvent", eventHandler)

for _, BarTextures in pairs({TargetFrameNameBackground, FocusFrameNameBackground, PlayerFrameNameBackground}) do
BarTextures:SetTexture("Interface\\TargetingFrame\ \UI-StatusBar")
end



rbkz is offline  
Reply

Tags
classcolor in playerframe



« WoW addon installer | [Suche] Tukui v11 für 3.3.5 »

Similar Threads
hilfe bei lua script/ need help with lua script
10/06/2014 - General Coding - 2 Replies
Hi leute ich versuche ein script in für mein Iphone zu schreiben und könnte ein bisschen hilfe von einem Experten gebrauchen können also wenn jemand was von lua versteht bitte bei mir per pn melden! Hey guys im trying to write a lua script on my...
[LUA] need help in decrypting / encrypting lua
08/12/2013 - General Coding - 7 Replies
The title pretty much says it all but ill explain a bit more as to what Im in need, basically I have decompiled a script using this website, i've got the code etc but it contains some really werid stuff like etc , I wanted to decrypt the file...
[Realase]Décripteur de fichier lua ressource 7.3 /Décripteur resource file lua 7.3
04/08/2012 - Rappelz Private Server - 5 Replies
Closed
Sehr weit geführte locale_.lua (locale_big5.lua)
08/02/2010 - Metin2 PServer Guides & Strategies - 50 Replies
Abend^^ Habe hier mal selber eine locale_.lua übersetzt! Ich habe mich von anderen localen inspirieren lassen habe sie aber bis auf 6 Zeilen selber geschrieben!! Ich werde sie, wenn ihr mir sagt welche quests die von zeile 300 - 900 sind, noch...



All times are GMT +2. The time now is 12:47.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.