#Crimson Rise I am new To roblox studio but i did get a decent code

1 messages · Page 1 of 1 (latest)

terse lava
#

Scripter 0/10
Builder 0/10
Coder 0/10
Animator 0/4
Ui maker 0/7
Tester 0/5
sound designer 0/8
i. cant pay because i dont make really money but i can pay soon in november or december

terse lava
#

Crimson Rise I am new To roblox studio but i did get a decent code

north flax
#

10 of these is crazy 🥀

autumn lion
#

Tuff

torn mirageBOT
#

studio** You are now Level 2! **studio

terse lava
broken pebble
terse lava
broken pebble
terse lava
#

oh okay

#

-- Place this in ServerScriptService
local DataStoreService = game:GetService("DataStoreService")
local PlayerStatsStore = DataStoreService:GetDataStore("PlayerStats")

-- Settings
local XPIncreasePerLevel = 1.25 -- multiplier for required XP per level
local BaseXPRequired = 100

-- Example skill: Combat
local Skills = {
Combat = {
BaseXP = BaseXPRequired,
XPPerAction = 50
},
Magic = {
BaseXP = BaseXPRequired,
XPPerAction = 30
}
}

-- Helper function to calculate XP needed for next level
local function GetXPRequired(level, baseXP)
return math.floor(baseXP * (XPIncreasePerLevel ^ (level - 1)))
end

-- Level-up function
local function LevelUp(player, skillName)
local stats = player:FindFirstChild("Stats")
if not stats then return end

local skill = stats:FindFirstChild(skillName)
if not skill then return end

local currentLevel = skill.Level.Value
local currentXP = skill.XP.Value
local requiredXP = GetXPRequired(currentLevel, Skills[skillName].BaseXP)

if currentXP >= requiredXP then
    skill.XP.Value = currentXP - requiredXP
    skill.Level.Value = currentLevel + 1
    print(player.Name .. "'s " .. skillName .. " leveled up to " .. skill.Level.Value)
end

end

-- Function to add XP to a skill
local function AddXP(player, skillName, amount)
local stats = player:FindFirstChild("Stats")
if not stats then return end

local skill = stats:FindFirstChild(skillName)
if skill then
    skill.XP.Value += amount
    LevelUp(player, skillName)
end

end

#

-- Setup Stats Folder for each player
game.Players.PlayerAdded:Connect(function(player)
local statsFolder = Instance.new("Folder")
statsFolder.Name = "Stats"
statsFolder.Parent = player

for skillName, skillData in pairs(Skills) do
    local skillFolder = Instance.new("Folder")
    skillFolder.Name = skillName
    skillFolder.Parent = statsFolder
    
    local level = Instance.new("IntValue")
    level.Name = "Level"
    level.Value = 1
    level.Parent = skillFolder
    
    local xp = Instance.new("IntValue")
    xp.Name = "XP"
    xp.Value = 0
    xp.Parent = skillFolder
end

-- Load data from DataStore
local success, data = pcall(function()
    return PlayerStatsStore:GetAsync(player.UserId)
end)

if success and data then
    for skillName, skillData in pairs(data or {}) do
        local skillFolder = statsFolder:FindFirstChild(skillName)
        if skillFolder then
            skillFolder.Level.Value = skillData.Level or 1
            skillFolder.XP.Value = skillData.XP or 0
        end
    end
end

end)

-- Save data when player leaves
game.Players.PlayerRemoving:Connect(function(player)
local stats = player:FindFirstChild("Stats")
if stats then
local dataToSave = {}
for _, skillFolder in pairs(stats:GetChildren()) do
dataToSave[skillFolder.Name] = {
Level = skillFolder.Level.Value,
XP = skillFolder.XP.Value
}
end

    pcall(function()
        PlayerStatsStore:SetAsync(player.UserId, dataToSave)
    end)
end

end)

-- Example usage: give Combat XP
-- Call: AddXP(player, "Combat", Skills.Combat.XPPerAction)

#

dont worry

#

i dont need help

broken pebble
nova coyote
torn mirageBOT
#

studio** You are now Level 2! **studio

terse lava
#

i just need help with animations

nova coyote
#

not

terse lava
#

ha

#

very funny

#

wait till i can make a entire game by myself

nova coyote
terse lava
#

Nah

#

i will animate

#

and make everything

remote dirge
terse lava
#

done witht he animation

#

i made the gun game

#

just gotta import a Pistol

#

and make it a head of creare and justguy

#

and i shoot them

north flax
terse lava
#

Wait

#

i can use ai for animations?

#

THAT WILL THEN SAVE ME FOR ANOTHER 4 HOURS

vital acorn
#

this is just rage bait

oak bobcat
gritty dagger
nova coyote