I'm sort of a beginner at lua coding, and I just can't seem to figure out how to make a code that when you press a button it will level up all of your skills... Does anyone know how to do this? I've actually made a code myself, but it doesn't seem to work. Can someone edit this and make it work? Thanks!
degradedscroll = {};
function degradedscroll.AddXP(_keyPressed)
print(_keyPressed);
if _keyPressed == 25 then
local player = getSpecificPlayer(0);
local xp = player:getXp();
local xpgained = 1000;
xp:AddXP(Perks.Aiming, xpgained);
xp:AddXP(Perks.Axe, xpgained);
xp:AddXP(Perks.Blunt, xpgained);
xp:AddXP(Perks.Cooking, xpgained);
xp:AddXP(Perks.Crafting, xpgained);
xp:AddXP(Perks.Farming, xpgained);
xp:AddXP(Perks.Fitness, xpgained);
xp:AddXP(Perks.Lightfoot, xpgained);
xp:AddXP(Perks.Melee, xpgained);
xp:AddXP(Perks.Nimble, xpgained);
xp:AddXP(Perks.Reloading, xpgained);
xp:AddXP(Perks.Sneak, xpgained);
xp:AddXP(Perks.Sprinting, xpgained);
xp:AddXP(Perks.Strength, xpgained);
xp:AddXP(Perks.Woodwork, xpgained);
end
end
Event.OnKeyPressed.Add(degradedscroll)