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

I cant rebirth when i click it in my game, is my script wrong?

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)

2 comments

0

Please put your code into a code block by selecting it then clicking the blue "Lua" button. This makes it much easier to read.

0

i will thank u

1 answer

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