FindFirstChild() checks if the value exists or not. Use WaitForChild() if you want to ensure the child exists.
If you change that line, it might work. An example could be:
local value = game.ReplicatedStorage:WaitForChild(point)
Also, if that doesn’t work, it could be because the Value property of the item is spelt with a capital V, but in the script you have referenced it with a lower case .value. Try changing that as well.
I’m pretty sure even if “value” is not nil since your calling “.value” instead of “.Value” as @12345koip said it will throw an error. Make sure before you check if the object your indexing is nil, check if what your calling on the Object is an actual thing(if that makes sense)
Always keep in mind that Luau is case sensitive, remember this especially when modifying a property of something,
it should be: value.Value = value.Value + 1
or make it shorter if you want value.Value += 1
How would I check that? I have both the values set to 0 and it’s in the script to set them to 0 at the beginning of the game too, but I can’t get the values to increase
Does it print 0 when your print “value.Value” ? make sure your saying “value.Value” since if you are indexing value with a lower case v it will print nothing or nil and wont error.
It could be that the variable name is too similar to the property name Value. Try changing the variable name to point.
So, the first line would change to:
point = game.ReplicatedStorage:WaitForChild(point)
the first parameter of OnServerEvent is the player who fired it, try game.ReplicatedStorage.CalVotes.OnServerEvent:Connect(function(plr,point). also FindFirstChild and WaitForChild use strings as the parameter, so it won’t work if you put an instance in there.