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

Value is not a valid member of folder?

Asked by 5 years ago
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?

0
wheres this error coming from? starmaq 1290 — 5y
0
ok so wait starmaq 1290 — 5y
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" starmaq 1290 — 5y
0
fix that, maybe you forgot to make your value object or maybe you are refering to it the wrong way starmaq 1290 — 5y
0
it worked before but now it isnt working xkingerx 0 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

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)
0
oh yah probarly starmaq 1290 — 5y
0
thats why showing off your error is improtant, people should get used to it starmaq 1290 — 5y
0
Wrong. His Value properties are already capitalized. DeceptiveCaster 3761 — 5y
0
@MC, read the script again, he has Strength.Value twice, but only the second one is capitalized SerpentineKing 3885 — 5y
Ad

Answer this question