so, i have been trying to make a simulator in roblox by watching alvinblox’s vid, I am on the second part of his series and i have finished all the scripting, However, when i clicked rebirth when i had all the requirments nothing happened. I have tracked where the problem is coming from but have no clue how to fix it. Please Help.
Script:
local replicatedStorage = game:GetService("ReplicatedStorage") local starterRebirthAmount = 10000
local player = game.Players.LocalPlayer local mainFrame = script.Parent:WaitForChild("MainFrame") local rebirthMenu = mainFrame:WaitForChild("RebirthMenu") local rebirthButton = script.Parent:WaitForChild("RebirthButton") local rebirthButtonInMenu = rebirthMenu:WaitForChild("RebirthButtonInMenu") local fatToRebirth = rebirthMenu:WaitForChild("FatToRebirth")
local rebirths = player:WaitForChild("leaderstats").Rebirths
fatToRebirth.Text = "You need at least "..math.floor((starterRebirthAmount +(rebirths.Value) * math.sqrt(100000000))).." fat to rebirth" print("got past") rebirthButton.MouseButton1Click:connect(function() mainFrame.Visible = not mainFrame.Visible
end)
rebirthButtonInMenu.MouseButton1Click:Connect(function() local result = replicatedStorage.Remotes.Rebirth:InvokeServer() if result ==true then rebirthButtonInMenu.Text = "Success" wait(1) rebirthButtonInMenu.Text = "Rebirth!!" elseif result == "NotEnoughStregnth" then rebirthButtonInMenu.Text = "Become more chubby" wait(1) rebirthButtonInMenu.Text = "Rebirth!!" end
end)
rebirths:GetProperteyChangedSignal("Value"):Connect(function() fatToRebirth.Text = "You need at least "..math.floor((starterRebirthAmount +(rebirths.Value) * math.sqrt(100000000))).." fat to rebirth" end)