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

Where is this Error rebirths is not a valid member of Folder?

i don't know where the error is in my script

local replicatedStorage = game:GetService("ReplicatedStorage")
local remoteData = game:GetService("ServerStorage"):WaitForChild("RemoteData")
local staterRebirthAmount = 5000

local cooldown = 1

replicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)
	
	if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end
	
	local debounce = remoteData[player.Name].Debounce
	
	if not debounce.Value then
		debounce.Value = true
		
		player.leaderstats.Shrinkage.Value = player.leaderstats.Shrinkage.Value + 10 * (player.leaderstats.rebirths.Value + 1)
		
		wait (cooldown)
		
		debounce.Value = false
	else
		
	end
end)

replicatedStorage.Remotes.Rebirths.OnServerInvoke = function(player)
	
	if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end
	
	local rebirths = player.leaderstats.Rebirths
	
	if player.leaderstats.Shrinkage.Value >=(math.floor((starterRebirthAmount + (rebirths.value) + math.sqrt(50000000)))) then
		
		rebirths.Value = rebirths.Value + 1
		
		player.leaderstats.Shrinkage.Value = 0
		
		player:LoadCharacter()
		
		return true
	else return "Not enough shrinkage"
	end
end

1 answer

Try add this

repeat wait() until player.leaderstats:FindFirstChild("Rebirths")
local rebirths = player.leaderstats.Rebirths

if this not work, that mean there is no Rebirths in the leaderstats folder.

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