Value of type Instance cannot be converted to a number (SOLVED)

I am trying to make an event which, when fired, changes the value of a NumberValue. But it doesn’t change the value.

Local Script (Located inside a TextButton):

local RS = game:GetService("ReplicatedStorage")

local button = script.Parent

button.MouseButton1Click:Connect(function()
	RS.AnomalyReport_EVENTS.SelectAnomaly:FireServer(1)
end)

Server Script:

local RS = game:GetService("ReplicatedStorage")

local configFolder = workspace.Game:FindFirstChild("Config")

RS.AnomalyReport_EVENTS.SelectAnomaly.OnServerEvent:Connect(function(value)
	configFolder.SelectedAnomaly.Value = value
end)

In addition, this warning is outputted:

value of type Instance cannot be converted to a number

1 Like

Try this

local RS = game:GetService("ReplicatedStorage")

local configFolder = workspace.Game:FindFirstChild("Config")

RS.AnomalyReport_EVENTS.SelectAnomaly.OnServerEvent:Connect(function(player,value)
	configFolder.SelectedAnomaly.Value = value
end)

I think remotevent self added who is fired that called “Player”
It was error because it fill Value as player not value argument
Screenshot (556)

1 Like

That solved the issue. Thank you so much! :smiley:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.