Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I make it cost 500 more Dominus's every rebirth?

Here's my script:

local open = false
local db = true

script.Parent.Parent.TextButton.MouseButton1Click:connect(function()
	script.Parent.Question.Text = "ARE YOU SURE YOU WANT TO BE REBIRTH?"
	if not open then
		script.Parent.Visible = true
		open = true
	else
		script.Parent.Visible = false
		open = false
	end
end)


script.Parent.Yes.MouseButton1Click:connect(function()
	if game.Players.LocalPlayer.leaderstats["Dominus's Collected"].Value < 5000 and db then
		db = false
		script.Parent.Question.Text = "YOU NEED ATLEAST 5,000 Dominus's TO REBIRTH!"
		wait(3)
		script.Parent.Visible = false
		open = false
		db = true
	elseif db then
		game.ReplicatedStorage.Rebirth:FireServer()
		script.Parent.Visible = false
		open = false
	end
end)

script.Parent.No.MouseButton1Click:connect(function()
	if db then
		script.Parent.Visible = false
		open = false
	end
end)

game.ReplicatedStorage.Rebirth.OnClientEvent:connect(function()
	script.Parent.Parent.Text:TweenPosition((UDim2.new(0.2, 0, 0.07, 0)), "Out", "Quad", 1)
	wait(3)
	script.Parent.Parent.Text:TweenPosition((UDim2.new(1.8, 0, 0.07, 0)), "Out", "Quad", 1)
	wait(1)
	script.Parent.Parent.Text.Position = UDim2.new(-0.6, 0, 0.07, 0)
end)

3 comments

0

The plural of dominus is domini

0

lol

0

Incap the rebirth works but i want to know how to make it cost more every rebirth

1 answer

✓ Accepted answer

Your best bet is to make a datastore script & have a intvalue that is called Rebirth. So Rebirth.Value=1 means you have no rebirths, which means it costs 500 domini to rebirth. Rebirth.Value=2 means you have 1 rebirth,which means it costs 1000 domini to rebirth. And so on. You can acheive this by using this in a local script:

local player = game.Players.LocalPlayer

local rebirthcost = 500 * player.leaderstats.Rebirth.Value

Then to take the money out use this in the local script:

player.leaderstats.Dominus.Value = player.leaderstats.Dominus.Value - rebirthcost

Also to add a rebirth.value use this line of code in the designated line:

player.leaderstats.Rebirth.Value = player.leaderstats.Rebirth.Value + 1
script.Parent.Yes.MouseButton1Click:connect(function()
	    if game.Players.LocalPlayer.leaderstats["Dominus's Collected"].Value < 5000 and db then
	        db = false
	        script.Parent.Question.Text = "YOU NEED ATLEAST 5,000 Dominus's TO REBIRTH!"
	        wait(3)
	        script.Parent.Visible = false
	        open = false
	        db = true
	    elseif db then
		----------------------------------------//RIGHT HERE\\--------------------------------------
	        game.ReplicatedStorage.Rebirth:FireServer()
	        script.Parent.Visible = false
	        open = false
	    end
	end)

P.S: In the datastore script make sure to set Rebirth.Value to 1 and not 0. You must have a leaderstat value called Dominus for this to work.

Hope this helped. If you need anymore help just ask.

3 comments

0

can you tell me step bye step on discord so i can accept answer if works

0

My discord is FreedomDucky#5531

0

Says you have to add me. EvolvedAstronaut#8716

This discussion is preserved as it was. New answers, comments, and votes are closed.