im making a system where orbs will spawn at assigned places, when leveled up, it will set exp back to 0, set the level up, add more to the expcap, add more to the jump and speed value and deletes the orb placed, none of it is working though and I need some help
EXP Orb Spawning Script In Workspace
local SpawnAmount = script.Value
local SmallEXP = game.ReplicatedStorage.Small
local SpawnPlaces = workspace.SpawnPlaces:GetChildren()
while SpawnAmount > 0 do
local clone = SmallEXP
clone.Parent = workspace
clone.Script.Enabled = true
task.wait(1)
for i = 1, #SpawnPlaces do
clone.CFrame(i, SpawnPlaces[i].Name).Position
end
end
Leveling Up System In Workspace
local Players = game:GetService("Players").LocalPlayer
local exp = Players.EXP
local expCap = Players.EXPCap
local remoteEvent = game.ReplicatedStorage.Remotes.LvlUp
while true do
if exp >= expCap then
remoteEvent:FireServer()
end
end
Stat Script In ServerScriptService
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LvlUp = ReplicatedStorage.Remotes.LvlUp
local SmallEXP = ReplicatedStorage.Remotes.EXP.Small
local humanoid = Players.LocalPlayer.FindFirstChild("Humanoid")
local plr = game.Players:GetPlayerFromCharacter(humanoid)
Players.PlayerAdded:Connect(function(player)
local speed = Instance.new("IntValue", player)
speed.Name = "Speed"
speed.Value = 8
local jump = Instance.new("IntValue", player)
jump.Name = "Jump"
jump.Value = 4
local exp = Instance.new("IntValue", player)
exp.Name = "EXP"
local expCap = Instance.new("IntValue", player)
expCap.Name = "EXPCap"
expCap.Value = 100
local level = Instance.new("IntValue", player)
level.Name = "Level"
level.Value = 1
end)
LvlUp.OnServerEvent:Connect(function(player)
player.Level.Value += 1
player.EXP.Value = 0
player.EXPCap.Value += 100
player.Speed.Value += 0.5
player.Jump.Value += 1
end)
Script In TextLabel
local Players = game:GetService("Players").LocalPlayer
local exp = Players.EXP
local expCap = Players.EXPCap
local Text = script.Parent
exp.Changed:Connect(function()
Text.Text = tostring(exp.Value).."/"..tostring(expCap.Value)
end)

2 comments
which one of the workspace scripts are supposed to be client scripts?
I'm referring to the "Leveling Up System" script . Ideally, it should not be running on the client as I explained in my answer, but you can move the local script to somewhere like StarterGui for it to run code.