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

Attempt to index nil with FindFirstChild How con i fix this?

This is my script pls help

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.Value then
	print("Got past Debounce if statement")
	debounce.Value = true
	player.leaderstats.strength.Value = player.leaderstats.strength.Value + 25 * (player.leaderstats.rebirths.Value + 1)
	wait(cooldown)
	debounce.Value = false
	
end

end)

1 answer

okay you're trying to search for a player in an instance called "RemoteData" so unless you are storing a value inside an event for some reason I would recommend searching for the players in game using game:GetService("Players")

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