So this is my script this is a rebirth now if you see in the code theres a child:remove() When i tested it it doesnt remove the child like how plz help im a nub at scripting :)
local replicatedStorage = game:GetService("ReplicatedStorage")
local StarterRebirthAmount = 60000
local player = game.Players.LocalPlayer
local mainframe = script.Parent:WaitForChild("MainFrame")
local rebirthMenu = mainframe:WaitForChild("Frame")
local mainbutton = script.Parent.MainButton
local rebirthbutton = rebirthMenu:WaitForChild("Rebirth")
local stregthnToRebirth = rebirthMenu:WaitForChild("Strenght")
local rebirths = player:WaitForChild("leaderstats").Rebirth
wait()
stregthnToRebirth.Text = "You need atleast "..math.floor((StarterRebirthAmount + (rebirths.Value) * math.sqrt(50000000))).." balloons to rebirth"
mainbutton.MouseButton1Click:Connect(function()
mainframe.Visible = not mainframe.Visible
end)
rebirthbutton.MouseButton1Click:connect(function()
local result = replicatedStorage.Remotes.Rebirth:InvokeServer()
if result == true then
if result == true then
local children = player.Backpack:GetChildren()
for i = 1, #children do
local child = children[i]
child:Remove()
end
rebirthbutton.Text = "succesfully rebirthed"
wait(1)
rebirthbutton.Text = "Click here to rebirth"
elseif result == "NotEnoughBalloons" then
rebirthbutton.Text = "Pro Tip:Grind More"
wait(2)
rebirthbutton.Text = "Click here to rebirth"
end
end
end)
rebirths:GetPropertyChangedSignal("Value"):Connect(function()
stregthnToRebirth.Text = "You need atleast "..math.floor((StarterRebirthAmount + (rebirths.Value) * math.sqrt(50000000))).." balloons to rebirth"
end)
All of you have a great night or day,God bless u
