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

Value 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:FindFirstChild(player.Name) then return "NoFolder" end
	
	local debounce = remoteData[player.Name]
	
	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
		
	end

end)

When I run the script it keeps saying value isnt a valid member of folder can somebody help?

5 comments

0

wheres this error coming from?

0

ok so wait

0

i think whats happening as you can see the variable "fdebounce" which is storing "remoteData[player.Name]" is refering to your player, so doing debounce.Value wont return anything since there isnt a value property to that object or theresnt a child parented to it named "Value"

0

fix that, maybe you forgot to make your value object or maybe you are refering to it the wrong way

0

it worked before but now it isnt working

1 answer

I believe your problem is that on line 16, the first "Strength.value" is not capitalized to "Strength.Value", meaning you aren't correctly indexing the property of Strength

Below is the Revised Code

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]
	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
	end
end)

4 comments

0

oh yah probarly

0

thats why showing off your error is improtant, people should get used to it

0

Wrong. His Value properties are already capitalized.

0

@MC, read the script again, he has Strength.Value twice, but only the second one is capitalized

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