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

Rebirth is not a valid member of Folder?

Asked by
rymer9 0
5 years ago

I dont know exactly what I did wrong, but every time I try to click rebirth on the GUI it shows up with an error called Rebirth is not a valid member of Folder.

  local replicatedStorage = game:GetService("ReplicatedStorage")

local remoteData = game:GetService("ServerStorage"):WaitForChild("RemoteData")

local starterRebirthAmount = 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.Strength.Value = player.leaderstats.Strength.Value + 25 * (player.leaderstats.Rebirths.Value + 1)

wait(cooldown)

debounce.Value = false

else

end

end)



replicatedStorage.Remotes.Rebirth,OnServerInvoke = function(player)

if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end

local rebirths = player.leaderstats.Rebirths

if player.leaderstats.Strength.Value >= (math.floor((starterRebirthAmount +(rebirths.Value) * math.sqrt(5000000)))) then

rebirths.Value = rebirths.Value + 1

player.leaderstats.Strength.Value = 0

player.LoadCharacter()

return true

else return "NotEnoughStrength"

end

end
0
For some reason the server can't access the rebirth value inside the leaderstats folder. Where are you creating the "rebirths" value? If it's on the client, it may not have replicated to the server if FE is on. whenallthepigsfly 541 — 5y

1 answer

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
5 years ago
Edited 5 years ago
  1. WaitForChild is your best friend.
  2. replicatedStorage.Remotes.Rebirth,OnServerInvoke = function(player) is incorrect. Change the comma to a period.

Make sure that the folder is being created and moved into the player/leaderstats folder by the server, and not the player.

Ad

Answer this question