Advertisement
Rochet2

Untitled

Nov 29th, 2023
842
0
203 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. -- ClientAddon.lua
  2. ------------------
  3. local AIO = AIO or require("AIO")
  4.  
  5. if AIO.AddAddon() then
  6.     return
  7. end
  8.  
  9. -- rest of the code...
  10. local button4 = CreateFrame("Button", "ButtonTest4", frame, "UIPanelButtontemplate")
  11. button4:SetSize(150, 40)
  12. button4:SetPoint("TOP", frame, "TOP", 0, -100)
  13. button4:SetText("Learn |cff" .. string.format("%02x%02x%02x", classColor.r * 255, classColor.g * 255, classColor.b * 255) .. playerClass .. "|r spells!")
  14. button4:SetNormalFontObject("GameFontNormal")
  15. button4:SetScript("OnClick", function(btn) AIO.Handle("ButtonFunctions", "Button4Click") end)
  16.  
  17. -- Server.lua
  18. ------------------
  19. local AIO = AIO or require("AIO")
  20. local MyHandlers = AIO.AddHandlers("ButtonFunctions", {})
  21. function MyHandlers.Button4Click(player)
  22.     print(player:GetName()) -- prints in server console as we are on server side
  23. end
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement