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

{My Username} Is not a valid member of Folder?

Asked by 5 years ago
Edited by royaltoe 5 years ago

This question has been solved by the original poster.

Hello, i'm relatively new to coding, especially on Roblox.

I've stumbled upon an error in which whilst testing it doesnt give me strength (i'm making a simulator game) but instead reads: Realkyklops is not a valid member of Folder Here's the code if anyone could help, Sorry!

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
        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
remoteData[player.Name] instead of remoteData(player.Name). also, you're not checking if the player has a leaderstat folder / if they have a strength value royaltoe 5144 — 5y
0
Tyvm You helped me out Royal, thanks ever so much RealKyklops 4 — 5y
0
:)) royaltoe 5144 — 5y

Answer this question