So, I'm trying to make a script that changes the text, which you can probably see, but I keep getting this error in the output that says that on line 17 "Attempt to compare two userdata values" Is there a way to get around this? Also, the values are all numbervalues. Here's my script
local pv = game:GetService("ReplicatedStorage").PointValues
local red = pv:WaitForChild("RedPoints")
local blue = pv:WaitForChild("BluePoints")
local green = pv:WaitForChild("GreenPoints")
local yellow = pv:WaitForChild("YellowPoints")
red.Changed:Connect(function()
while wait() do
if red > blue and red > green and red > yellow then --if red is winning
script.Parent.Text = "Red Has the Most Points!"
end
end
end)
blue.Changed:Connect(function()
while wait() do
if blue > red and blue > green and blue > yellow then--if blue is winning
script.Parent.Text = "Blue Has the Most Points!"
end
end
end)
green.Changed:Connect(function()
while wait() do
if green > red and green > blue and green > yellow then--if green is winning
script.Parent.Text = "Green Has the Most Points!"
end
end
end)
yellow.Changed:Connect(function()
while wait() do
if yellow > red and yellow > blue and yellow > green then
script.Parent.Text = "Yellow Has the Most Points!"--if yellow is winning
end
end
end)

2 comments
Are the colors (RedPoints, etc.) all IntValues?
They are all numbervalues