How can i make this load with the game?
i would like to make this load automatically with the game
/script MainMenuBarLeftEndCap:Hide() MainMenuBarRightEndCap:Hide() |
|
Quote:
|
Ok, I am not a coder so this might look/sound funny to some of you. but after some reading ive come up with this
function grifremove:PLAYER_ENTERING_WORLD() MainMenuBarLeftEndCap:Hide() MainMenuBarRightEndCap:Hide() end but it doesnt work. basically i have just this line in a lua file in a folder in my addons. it shows the addon in my list but when i login it doesnt remove the gryphons. i really wanna make this work as opposed to downloading another mod for this one simple function. any help is greatly appericiated. |
you will need to add the line you used in a macro (minus the /script part. Ie. MainMenuBarLeftEndCap:Hide() MainMenuBarRightEndCap:Hide()) to an addon already registered for the event, a new addon, or register the addon you added the lines to for the event yourself.
|
Quote:
|
Basically, in a function that runs when a mod loads (e.g. the OnLoad for a frame), that's where you register events. The format for doing that is just to add this line into an OnLoad function:
if you're doing it in a specific frame's OnLoad: Code:
this:RegisterEvent("EVENT_NAME"); Code:
framename:RegisterEvent("EVENT_NAME"); Now, if I were to create your code as a standalone mod, I would do it like this: Assume that I've created a frame named Frame. I would set this function to its OnLoad Code:
function Frame_OnLoad() Code:
function Frame_OnEvent(event) Anyway, hope that helps you understand a bit better. ;) |
thanks i think i might have it figured out now
|
ok. this is what i have. from what ive read/seen in other mods i personally think this should work. but alas it is not.
Code:
grifremove = CreateFrame("Frame") what am i doing wrong? |
Are you sure you need an event to do it, I'm pretty sure you could just do.
Code:
MainMenuBarLeftEndCap:Hide() and heres an example of a super simple event handler: Code:
local function OnEvent(f, event, args) |
Quote:
BasicBuffHide does it like that, and it works. Looky here: http://files.wowace.com/BasicBuffHid...ide-r54514.zip |
All times are GMT -6. The time now is 01:41 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI