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.