im trying to send data to a local script but whenever i try i get this error on line 8
players.PlayerAdded:Connect(function(player)
local stamina = Instance.new("IntValue", player)
stamina.Value = maxStamina
stamina.Name = "Stamina"
stamina.Changed:Connect(function(player)
rs.StaminaUpdate:FireClient(player, stamina.Value, maxStamina)
end)
end)

5 comments
what is the error?
Is the error in the arguments or is it in the function on line 8
the error is unable to cast value to object and i think its the part where i fireclient and send the data (player, stamina,Value, maxStamina)
is maxStamina an IntValue as well? On both line 4 and 8 it should be maxStamina.Value
max stamina is a float not an actually object its a variable i made local maxStamina = 500