Hello there, I have a script here where it's supposed to detect how many parts does a folder have and that amount of folder's parts will be the player's value in the leaderboards, however it does not work, how do I fix this?
local user = game:GetService("Players").LocalPlayer
local RS = game:GetService("ReplicatedStorage")
local Checker = RS:WaitForChild("CheckerEvent")
local teams = game:GetService("Teams")
local leaderstats = user:WaitForChild("leaderstats")
local blocks = leaderstats:WaitForChild("Blocks")
---------------
local red = workspace.Blocks.Red:GetChildren()
local blue = workspace.Blocks.Blue:GetChildren()
---------------
Checker.OnClientEvent:Connect(function(event)
if user.Team == teams.Red then
blocks.Value = #red
else
blocks.Value = #blue
end
end)
