its not adding the 1.1 when i rebirth like if i would get 10 gems it should give me 11 with the 1.1
local CoinsAdded = 1 – Base amount of gems added per pickup
local RespawnTime = 0.5 – Time before the gem respawns
local Debounce = false
local PickedUp = false – Track if the gem has been picked up
script.Parent.Touched:Connect(function(touched)
if Debounce or PickedUp then
return
end
local Player = game.Players:GetPlayerFromCharacter(touched.Parent)
if Player then
local Leaderstats = Player:FindFirstChild("leaderstats")
local Coins = Leaderstats and Leaderstats:FindFirstChild("Gems")
local Rebirth = Leaderstats and Leaderstats:FindFirstChild("Rebirth")
if Coins and Rebirth then
Debounce = true
local gemMultiplier = 1.1 ^ Rebirth.Value -- Calculate the gem multiplier based on rebirth count
Coins.Value = Coins.Value + (CoinsAdded * gemMultiplier) -- Apply the multiplier to the base amount for each gem collected
script.Parent.Transparency = 1
PickedUp = true -- Mark the gem as picked up
wait(RespawnTime)
script.Parent.Transparency = 0
Debounce = false
print("Rebirth count:", Rebirth.Value)
print("Gem multiplier:", gemMultiplier)
end
end
Is Rebirth a NumberValue or IntValue?
You can check this by selecting Rebirth inside the Explorer and looking in the Properties window, look for ClassName and if it says IntValue or NumberValue.