can somebody help

im coding a weapon script to control stuff like ammo amount,reloading and other things but im getting this error

Assets/scripts/weapon.cs(8,26): error CS0031: Constant value 1' cannot be converted to a int’

here is the code what is causing this

using UnityEngine;
using System.Collections;

public class weapon : MonoBehaviour {

public int rounds = 17;
public int curentrounds = 17;
public int animspeed = 1.0;
public GameObject gun;
public AnimationClip fire;
public AnimationClip reload;


	// Use this for initialization
	void Start () {
	animspeed = AnimationState.speed = animspeed;
	
	
	}
	
	// Update is called once per frame
	void Update () 
		{	
			if (Input.GetMouseButtonDown(0))
			{	
				animation.Play (fire);
				curentrounds -=1;
				
			if (curentrounds <= 0)
								;
				animation.Play (reload);
				animspeed = 0.5f; 
			}	
			else
			{	
			if (Input.GetKeyDown(KeyCode.R))
				animation.Play (reload);
				 animspeed = 1f;
			}
	}
}

a little info i wanted to punish the player for not reloading when they had low ammo,so if they let the gun dry fire it will slow the reloading animation

thank you for your time and effort in advance

Edited Answer…:

void Start() {

    animation["AnimationName"].speed = animspeed;

}

and make sure animspeed variable is:

public float animspeed = 1.0f;

Hi, the problem (error) is in the following line:

public int animspeed = 1.0;

You have defined an integer (whole number) but you have assigned a decimal, to fix it either change the animSpeed type to a float or change the assignment to a whole number but I think you probably want this:

public float animspeed = 1.0f;

Hope that helps =D