Converted Player input and ai script into c#