Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
221
Vocation Selector #119
Until Oxygen server allows you to player:getVocation() this will allow you to select your vocation and then use it in your scripts.
813b | 35 lines.
--[[
  Script made by Lee (Discord: l33_) - www.trainorcreations.com
  If you want to support my work, feel free to donate at https://trainorcreations.com/donate
  PS. Stop ripping off my work and selling it as your own.
]]--
if not storage.vocation then
    storage.vocation = 1
end

local vocSelector = setupUI([[
Panel
  height: 150
  layout:
    type: verticalBox
    fit-children: true
  Label
    text: Vocation
    text-align: center
    margin-top: 6
  ComboBox
    id: playerVoc
    height: 20
    margin: 3
    @onSetup: |
      self:addOption("Sorcerer", 1)
      self:addOption("Druid", 2)
      self:addOption("Paladin", 3)
      self:addOption("Knight", 4)
]])

vocSelector.playerVoc:setCurrentIndex(storage.vocation)
vocSelector.playerVoc.onOptionChange = function(widget)
    storage.vocation = widget:getCurrentOption().data
end

 -- To use call storage.vocation in your scripts.
 -- EG:
 -- if storage.vocation == 1 then -- Sorcerer
 -- elseif storage.vocation == 2 then -- Druid
 -- end

22 Jun 2024
Ads