#Crimson Rise I am new To roblox studio but i did get a decent code
1 messages · Page 1 of 1 (latest)
Crimson Rise I am new To roblox studio but i did get a decent code
10 of these is crazy 🥀
Tuff
** You are now Level 2! **
No not actually 10 just to make sure the game isnt bad
will you help me?
no
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
i'll help you
really?
** You are now Level 2! **
i just need help with animations
not with vibe coding
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
With ai ofcourse
this is just rage bait
Ty for this
even games with million of ccu dont have that much employees 💀
Why is scripter and coder separate 💀