#someone help me,

1 messages · Page 1 of 1 (latest)

edgy flicker
#

someone help me, i am doing a game like capybara evolution, normally when i break a block i earn 1 win, but when i break a block after a rebirth i earn 10 wins(rebirth havent use), and it just happen one time
i am gonna show the code
block code:

local part = script.Parent
local clickDetector = part:WaitForChild("ClickDetector")
local blocolife = 100
local bbg = part:FindFirstChild("BillboardGui")
local bbgtx = bbg and bbg:FindFirstChild("TextLabel")

bbgtx.Text = tostring(blocolife)

part:FindFirstChild("ClickDetector").MouseClick:Connect(function(player)
    print (player.Name.."clicou no botão")
    local leaderstats = player:FindFirstChild("leaderstats")
    if not leaderstats then
        warn("Leaderstats não encontrados para", player.Name)
        return
    end

    local power = leaderstats:FindFirstChild("power")
    if not power then
        warn("Power não encontrado")
        return
    end
    
    local money = leaderstats:FindFirstChild("money")
    if not money then
        warn ("money nao encontrado")
        return
    end

    print (power.Value)

    blocolife = blocolife - power.Value

    if bbgtx then
        bbgtx.Text = tostring(blocolife)
    end

    if blocolife <= 0 then
        money.Value = money.Value +1
        part.Position = Vector3.new(-20, -10, 9)
        bbg.Enabled = false
        wait(3)
        bbg.Enabled = true
        part.Position = Vector3.new(-20, 2, 9)
        blocolife = 100
        bbgtx.Text = tostring(blocolife)
    end
end)``

```lua
rebirth code:
local players = game:GetService("Players")
local player = players.LocalPlayer
local statss = player:FindFirstChild("leaderstats")
local rebirth = statss:FindFirstChild("rebirth")
local money = statss:FindFirstChild("money")

script.Parent.Activated:Connect(function()
    if money.Value >=10 then
        rebirth.Value +=1
        money.Value -=10
    end
end)```
stable jolt
#

On the last part when you increase the money multiply it by the rebirth 10 if the rebirths starts at 1, but if rebirth starts at 0 then do something like 10(rebirth+1)

#

Can u explain how u want the rebirth to work

sharp sleet
#
local players = game:GetService("Players")
local player = players.LocalPlayer
local statss = player:FindFirstChild("leaderstats")
local rebirth = statss:FindFirstChild("rebirth")
local money = statss:FindFirstChild("money")

script.Parent.Activated:Connect(function()
    if money.Value >=10 then
        rebirth.Value +=1
        money.Value -=10
    end
end)```
dont do that on the client bruh
edgy flicker
#

@stable jolt , rebirths have no use for now

stable jolt
edgy flicker
#

usually a block give 1 win, but after a rebirth i break a block and he gives 10 wins + block win(1)

#

i need to leave now, after i come here