Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why when i click the rebirth button, it does not closed whenever the Player rebirth is true?

Asked by 3 years ago

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)

0
just change it to RebirthFrame.Visible = false Pupppy44 671 — 3y
0
it doesnt work Blackbooks 138 — 3y

Answer this question