[SOLVED] Rebirth not multiplying Multiplier

Worked but it gived an insane amount of Rebirth after you touched the button and still doesn’t multiply Multiplier…

Script:

--// Settings \\--

local Multi = 1 -- Set how much multiplier to multy your Multiplier Value
local MultiplierNeeded = 150 -- How much you need to rebirth
local AmountRebirth = 0 -- How much the player rebirthed
local GUI = script.Parent.Part.GUI
local TextLabel = GUI.TextLabel
local config = script.Parent.Config

--// Script \\--

script.Parent.Part.Touched:Connect(function(Touch) -- Calls a function when something is touching the part
	local Plr = game.Players:GetPlayerFromCharacter(Touch.Parent) -- gets the player
	if Plr then -- if the variable Player is true (if the variable is nil then its false and if its not nil then its true)
		--// Variable \\--
		local Multiplier = Plr.Stats.Multiplier -- gets the multiplier Value
		local Rebirth = Plr.Stats.Rebirth
		-- End of variables --
		Multi = Multi + 1
		MultiplierNeeded = MultiplierNeeded * 2
		AmountRebirth = AmountRebirth + 1
		Multiplier.Value = 1 -- Sets the value to 1
		Rebirth.Value = AmountRebirth -- sets the value to whatever is the AmountRebirth
	end
end)
-- // Setting of the Text \\ --
script.Parent.Part.GUI.TextLabel.Text = "x"..config.Cost.Value.." = "..config.Amount.Value.." Rebirth"

Try changing

player.Stats.Multiplier.Value = 1

To

player.Stats.Multiplier.Value += 1

It will be set to 2 instead of 1 (I guess)…

1 Like

It didn’t resetted the Multiplier, it gives 1 instead of removing or fixing it to 1…

stop copying my reply PLSSSSSSSSSSSS

oh wait nvm i am a idiot its the owner

I just modified the script a little bit…

Maybe the issue here, is probably the Multiplier doesn’t find the rebirth:

local config = script.Parent.Config
script.Parent.Part.Touched:Connect(function(hit) -- this is when player touches button (with characther)
	if hit.Parent:FindFirstChildOfClass("Humanoid") then
		if game.Players:GetPlayerFromCharacter(hit.Parent) then
			local player = game.Players:GetPlayerFromCharacter(hit.Parent)
			if player:FindFirstChild("Stats") and player.Stats:FindFirstChild("Rebirth") then
				if player.Stats.Cash.Value >= config.Cost.Value then -- checks if player multi is more or equal to cost (in config)
					player.Stats.Multiplier.Value = player.Stats.Multiplier.Value + config.Amount.Value
					player.Stats.Cash.Value = player.Stats.Cash.Value - config.Cost.Value
				end
			end
		end
	end
end)

script.Parent.Part.GUI.TextLabel.Text = "$"..config.Cost.Value.." = x"..config.Amount.Value

Here’s the LocalFile:

Bug of the Multiplier or Rebirth.rbxl (51.3 KB)

I found it guys, it was insanely chaotically hard since over these 2 weeks since this topic, and a few months of this bug.

Script:

local config = script.Parent.Config -- now lets change it so it's for rebirths by making it reseting the multi and cash at the same time !
script.Parent.Part.Touched:Connect(function(hit) -- this is when player touches button (with characther)
	if hit.Parent:FindFirstChildOfClass("Humanoid") then
		if game.Players:GetPlayerFromCharacter(hit.Parent) then
			local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
			if plr:FindFirstChild("leaderstats") and plr.leaderstats:FindFirstChild("Rebirth") then
				if plr.leaderstats.Cash.Value >= config.Cost.Value then -- checks if player multi is more or equal to cost (in config)
					plr.leaderstats.Multiplier.Value = plr.leaderstats.Multiplier.Value + config.Amount.Value
					plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value - config.Cost.Value
					plr.leaderstats.Multiplier.Value = plr.leaderstats.Rebirth.Value + plr.leaderstats.Multiplier.Value-1
					print("You got "..config.Amount.Value.." Multiplier and lost "..config.Cost.Value.." Cash. So now you have "..plr.leaderstats.Cash.Value.." Cash and "..plr.leaderstats.Multiplier.Value.." Multiplier.")
				end
			end
		end
	end
end)

script.Parent.Part.GUI.TextLabel.Text = "$"..config.Cost.Value.." = x"..config.Amount.Value

It was painfully hard to find this bug but i found it !

@SamirDevs forgot to put this line:

plr.leaderstats.Multiplier.Value = plr.leaderstats.Rebirth.Value + plr.leaderstats.Multiplier.Value-1

But the Print Statement didn’t worked, it just gives 1 instead, and i’m even looking on it.

Well, that’s fixed.

local config = script.Parent.Config -- now lets change it so it's for rebirths by making it reseting the multi and cash at the same time !
script.Parent.Part.Touched:Connect(function(hit) -- this is when player touches button (with characther)
	if hit.Parent:FindFirstChildOfClass("Humanoid") then
		if game.Players:GetPlayerFromCharacter(hit.Parent) then
			local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
			if plr:FindFirstChild("leaderstats") and plr.leaderstats:FindFirstChild("Rebirth") then
				if plr.leaderstats.Cash.Value >= config.Cost.Value then -- checks if player multi is more or equal to cost (in config)
					plr.leaderstats.Multiplier.Value = plr.leaderstats.Multiplier.Value + config.Amount.Value
					plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value - config.Cost.Value
					plr.leaderstats.Multiplier.Value = plr.leaderstats.Rebirth.Value + plr.leaderstats.Multiplier.Value-1
					print("You got "..plr.leaderstats.Rebirth.Value.." Multiplier and lost "..config.Cost.Value.." Cash. So now you have "..plr.leaderstats.Cash.Value.." Cash and "..plr.leaderstats.Multiplier.Value.." Multiplier.")
				end
			end
		end
	end
end)

script.Parent.Part.GUI.TextLabel.Text = "$"..config.Cost.Value.." = x"..config.Amount.Value

@msix29 Thanks to try to help me.
@Moleza Thanks to try to help me.
@GlitchedAli Thanks to try to help me.