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

it sed in the output FirstChild is not a valid member of Folder?

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

local cooldown = 1


replicatedStorage.Remotes.Lift.OnServerEvent:Connect(function(player)
	
	if not remoteData:FirstChild(player.name) then return "NoFolder" end
	
	local debounce = remoteData[player.name].Debounce
	
	if not debounce then
		debounce.Value = true
		
		player.Leaderstats.Strenght.Value = player.Leaderstats.Strenght.Value + 25 * (player.Leaderstats.Rebirths.Value + 1)
		
		wait(cooldown)
		
		debounce.Value = Faces

	end 
	
	
end)

1 comment

0

use FindFirstChild instead of firstchild

1 answer

The correct method is :FindFirstChild() not :FirstChild()

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

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 then
        debounce.Value = true

        player.Leaderstats.Strenght.Value = player.Leaderstats.Strenght.Value + 25 * (player.Leaderstats.Rebirths.Value + 1)

        wait(cooldown)

        debounce.Value = Faces

    end 


end)

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