-- Global table to store player-specific data PlayerData = {} -- Define class functions classFunctions = { necromancer = function(Player) Player:SendMessage("§6You are now a Necromancer!") Player:GetInventory():AddItem(cItem(E_ITEM_BONE, 1)) -- Example starting item PlayerData[Player:GetUUID()] = { Class = "Necromancer" } -- Store class in the table print("Assigned class 'Necromancer' to player: " .. Player:GetName()) end, druid = function(Player) Player:SendMessage("§2You are now a Druid!") Player:GetInventory():AddItem(cItem(E_ITEM_SAPLING, 5)) -- Example starting items PlayerData[Player:GetUUID()] = { Class = "Druid" } print("Assigned class 'Druid' to player: " .. Player:GetName()) end, -- Add other classes here... } -- Handle /class command function HandleClassCommand(Split, Player) if #Split < 2 then Player:SendMessage("§cUsage: /class ") return true end local class = Split[2]:lower() if classFunctions[class] then classFunctions[class](Player) Player:SendMessage("§aYou are now a " .. class .. "!") else Player:SendMessage("§cUnknown class! Available classes: necromancer, druid") -- Add others end return true end -- Initialize function function Initialize() print("Classes plugin initializing...") -- Bind /class command cPluginManager:BindCommand("/class", "", HandleClassCommand, "§6Select your class: /class ") print("Command '/class' registered successfully!") -- Bind /checkclass debug command cPluginManager:BindCommand("/checkclass", "", function(Split, Player) local uuid = Player:GetUUID() local data = PlayerData[uuid] if data then Player:SendMessage("§aYour class: " .. (data.Class or "None")) print("Player " .. Player:GetName() .. " checked their class: " .. data.Class) else Player:SendMessage("§cNo class assigned!") print("Player " .. Player:GetName() .. " has no assigned class.") end return true end, "§6Check your class: /checkclass") print("Command '/checkclass' registered successfully!") -- Plugin successfully initialized print("Classes plugin initialized successfully!") return true end