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

'Cough is not a valid member of folder'?

Asked by 4 years ago

So me and my friends are making a virus-disease-based simulator, and I am debugging some code with print statements. I cant get passed the Debounce if statement because it claims that 'Cough is not a valid member of Folder'. Please help.

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

local cooldown = 1

replicatedStorage.Remotes.Cough.OnServerEvent:Connect(function(player)

    print ("Fired")

    if not remoteData:FindFirstChild(player.Name) then return "NoFolder" end



    local debounce = remoteData[player.Name].Debounce

    if not debounce.Value then

        print ("Got past the Debounce if statement")

        debounce.Value = true

        player.leaderstats.Cough.Value = player.leaderstats.Cough.Value + 25 * (player.leaderstats.Rebirths.Value + 1)

        wait(cooldown)

        debounce.Value = false

    end

end)

NOTE: The print statements are included for debugging. Just in case you were wondering.

0
Is cough part of the ReplicatedStorage? Raccoonyz 1092 — 4y
0
Yes. There is a folder called Remotes in ReplicatedStorage, inside said folder is the remote event, Cough. JDCreations 0 — 4y
0
How is the script supposed to work? Is it supposed to go up every few minutes or when they click a button? iiMxtt_Destinyii 62 — 4y
0
When the you left-click, it is supposed to add a cough. But right now there's just a problem with the debounce. JDCreations 0 — 4y

Answer this question