i try to make this rebirth system. And i wonder how to make the rebirth frame dissapear when i click the rebirth button and rebirthed.

local player = game.Players.LocalPlayer

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Rebirth = ReplicatedStorage:WaitForChild("Rebirth")

local OpenRebirthFrame = script.Parent:WaitForChild("OpenRebirthFrame")
local RebirthFrame = script.Parent:WaitForChild("RebirthFrame")
local RebirthButton = RebirthFrame:WaitForChild("RebirthButton")

local leaderstats = player:WaitForChild("leaderstats")
local Rebirths = leaderstats:WaitForChild("Kepintaran")

OpenRebirthFrame.MouseButton1Up:Connect(function()
	local ilmuDibutuhkan = Rebirths.Value *15+15
	RebirthFrame.Visible = not RebirthFrame.Visible
	RebirthFrame.RequiredIlmu.Text = "Ilmu Yang Dibutuhkan ".. ilmuDibutuhkan
	RebirthFrame.MultiplierInfo.Text = "Kelipatannya Akan Menjadi ".. Rebirths.Value + 2 .. "X"
end)

RebirthButton.MouseButton1Up:Connect(function()
	local ilmuDibutuhkan = Rebirths.Value *15+15
	local playerRebirthed = Rebirth:InvokeServer()
	if playerRebirthed == true then
		RebirthFrame.Visible = not RebirthFrame.Visible --i though this code will make the frame dissapear when i rebirthed
		RebirthFrame.RequiredIlmu.Text = "Ilmu Yang Dibutuhkan ".. ilmuDibutuhkan
		RebirthFrame.MultiplierInfo.Text = "Kelipatannya Akan Menjadi ".. Rebirths.Value + 2 .. "X"
		
	end
end)

2 comments

0

just change it to RebirthFrame.Visible = false

0

it doesnt work