Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ClientAddon.lua
- ------------------
- local AIO = AIO or require("AIO")
- if AIO.AddAddon() then
- return
- end
- -- rest of the code...
- local button4 = CreateFrame("Button", "ButtonTest4", frame, "UIPanelButtontemplate")
- button4:SetSize(150, 40)
- button4:SetPoint("TOP", frame, "TOP", 0, -100)
- button4:SetText("Learn |cff" .. string.format("%02x%02x%02x", classColor.r * 255, classColor.g * 255, classColor.b * 255) .. playerClass .. "|r spells!")
- button4:SetNormalFontObject("GameFontNormal")
- button4:SetScript("OnClick", function(btn) AIO.Handle("ButtonFunctions", "Button4Click") end)
- -- Server.lua
- ------------------
- local AIO = AIO or require("AIO")
- local MyHandlers = AIO.AddHandlers("ButtonFunctions", {})
- function MyHandlers.Button4Click(player)
- print(player:GetName()) -- prints in server console as we are on server side
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement