Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- remote handler script, replace current rebirth with this.
- -- make sure to adjust so it works with ur game.
- -- Rebirth
- function Rebirth(Player, Amount) -- this will run the action when you passed all requirements for rebirthing
- Player.Data.PlayerData.Currency.Value = 0
- Player.Data.PlayerData.Rebirth.Value += Amount
- local gemX = Multipliers.CurrencyMultiplier2(Player)
- if gemX > 0 then -- gem calc
- Player.Data.PlayerData.Currency2.Value += 0.5 * Amount * Multipliers.CurrencyMultiplier2(Player)
- else
- Player.Data.PlayerData.Currency2.Value += 0.5 * Amount
- end
- end
- Remotes.Rebirth.OnServerEvent:Connect(function(Player, Amount)
- if Cooldowns[Player.Name] == false then
- Cooldowns[Player.Name] = true
- if GameSettings.RebirthType.Value == "Linear" then
- if Player.Data.PlayerData.Currency.Value >= GameSettings.RebirthBasePrice.Value * Amount * (Player.Data.PlayerData.Rebirth.Value + 1) then
- Rebirth(Player, Amount)
- end
- else
- if Player.Data.PlayerData.Currency.Value >= GameSettings.RebirthBasePrice.Value * Amount * (GameSettings.RebirthMultiplier.Value + 1.25) ^ Player.Data.PlayerData.Rebirth.Value then
- Rebirth(Player, Amount)
- end
- end
- task.wait(0.08)
- Cooldowns[Player.Name] = false
- end
- end)
- Remotes.RebirthButtonBuy.OnServerEvent:Connect(function(player, button, cost)
- if player and button and cost then
- if player.Data.PlayerData.Currency2.Value >= cost then
- player.Data.PlayerData.Currency2.Value -= cost
- player.Data.PlayerData.RebirthButton.Value = button
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment