With the rapid development of technologies and applications, extending from trusted environments to untrusted environments is the development trend of Internet of Things (IoT) applications. Due to the limited resources of nodes and the rise of edge computing, more and more IoT applications are required to have task delegation functions. Delegating IoT tasks in untrusted environments has to solve two problems: First, how to evaluate the trustworthiness of nodes so that requesters can delegate tasks to trusted providers; the second is how to ensure the successful implementation of the task delegation between the requester and the provider. While trust models are often used to solve the first problem, the lack of ability to describe transactions between the requester and the provider makes them unsuitable for solving the second problem. In recent years, game theory has been more applied to task delegation. By setting appropriate utility functions, game theory can ensure the successful implementation of task delegation. However, since it is unable to evaluate the trustworthiness of nodes, game theory cannot solve the first problem. This paper combines the advantages of trust models and game theory to construct a game of three-party task delegation based on trust to explore a solution to problems of IoT task delegation in an untrusted environment. Finally, aiming at the problem that setting essential parameter values of trust models is empirical and experimental, this paper theoretically discusses how to set these values in an untrusted environment.