Problem
You are attempting to iterate through an Instance instead of the required table.
The error itself means you are providing an Instance where you should be providing a table. The error also provides a location as to where you are providing an Instance instead of a table (line 5).
Solution
In your situation, using the :GetChildren() or :GetDescendants() methods will solve your issue as both of these methods return tables.
Code
local remote = game.ReplicatedStorage.Roll
local ls = game.Players.LocalPlayer.leaderstats:WaitForChild("Rolls")
game.ReplicatedStorage.Roll.OnClientEvent:Connect(function()
for _, v in pairs (ls:GetChildren()) do
if v:IsA("IntValue") then
v.Value += 1
end
end
ls.Value = ls.Value + 1
end)
Conclusion
If you are confused by anything in this answer, or have more questions, feel free to contact me though my Discord server
4 comments
put :GetChildren() after ls on line 5
its not doing anything now and it wont tell me why
After you put :GetChildren() after "Is", put print statements in your if statement then tell me if it's not printing.
not printing