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"
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
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 !
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