I keep getting this error saying "attempt to perform arithmetic on field 'Value' (a string value)"
local seats = workspace.Seats
local replicatedstorage = game:GetService("ReplicatedStorage")
local num = replicatedstorage:WaitForChild('InfoValue2')
for _,seat in pairs(seats:GetChildren()) do
if seat:IsA("Seat") then
seat:GetPropertyChangedSignal("Occupant"):connect(function()
if seat.Occupant ~= nil then
num = num.Value + 1 --THIS IS THE LINE I GET THE ERROR FROM.
else
num = num.Value - 1
end
end)
end
end
It's suppose to added a number to the value every time I player sits, for an example if there's 2 people sitting down on the seat and another player sits, it's suppose to change the value from 2 to 3. (The String Value changes the text to a UI.)
