WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   KGPanels Vehicle Script not working (https://www.wowinterface.com/forums/showthread.php?t=34081)

TrotskyIcepick 07-20-10 01:44 PM

KGPanels Vehicle Script not working
 
Hi All,

I have the following in my kgpanels.lua:

["LOAD"] = "self:RegisterEvent(\"UNIT_ENTERED_VEHICLE");n
self:RegisterEvent(\"UNIT_ENTERING_VEHICLE");n
self:RegisterEvent(\"UNIT_EXITING_VEHICLE");n
self:RegisterEvent(\"UNIT_EXITED_VEHICLE\");",

["EVENT"] = "if (event == \"UNIT_ENTERED_VEHICLE\") then\n
if ( arg1 == \"player\" ) then\n
self.hide = true;\n
end\n
else if ( event == \"UNIT_EXITED_VEHICLE\" ) then\n
if ( arg1 == \"player\" ) then\n
self.show = true;\n
end\n
end\n

When I enter a vehicle, nothing happens. When I added the scripts to the onLoad and onEvent settings for the panel they were accepted as being valid.

Anybody got any ideas as to why this isn't working?

Thanks In Advance.
end"

TrotskyIcepick 07-21-10 06:49 PM

Tried moving the RegisterEvents to the onEvent setting for the kgpanel but still doesn't work.

Does nobody have any ideas?

suicidalkatt 07-21-10 07:06 PM

It's just self:Hide() not self.hide = true, self:Show() etc.

Edit: typo, colons not "."

TrotskyIcepick 07-22-10 12:19 PM

Thanks for that, I'll give it a try tonight ;-)

TrotskyIcepick 07-26-10 05:12 PM

Quote:

Originally Posted by suicidalkatt (Post 199245)
It's just self:Hide() not self.hide = true, self:Show() etc.

Edit: typo, colons not "."

Nope, that produces the following errors:

Date: 2010-07-27 00:09:27
ID: 2
Error occured in: Global
Count: 1
Message: [string "HUD_OnEvent"] line 11:
attempt to call method 'show' (a nil value)
Debug:
[C]: show()
[string "HUD_OnEvent"]:11:
[string "HUD_OnEvent"]:1

Pretty much the same error occurs on both vehicle entry and exit.

Seerah 07-26-10 05:16 PM

show is not the same as Show

TrotskyIcepick 07-27-10 10:56 AM

You are absolutely right....I didn't realise LUA was case sensitive, will try later.

Someone should update the KGPanels website, which is where I got my script from in the first place.

Thanks.

Seerah 07-27-10 03:09 PM

It's also Lua (the Portuguese word for 'moon') and not LUA. ;) But that's a different topic. ;)


All times are GMT -6. The time now is 03:46 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI