diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c
index dd74393214592bd862a911d6a0ecf65963b03264..1b219c70a102ff7bc9b0340e5079c73b1e1c691a 100644
--- a/src/lua_playerlib.c
+++ b/src/lua_playerlib.c
@@ -628,7 +628,7 @@ static int power_get(lua_State *L)
 	UINT16 *powers = *((UINT16 **)luaL_checkudata(L, 1, META_POWERS));
 	powertype_t p = luaL_checkinteger(L, 2);
 	if (p >= NUMPOWERS)
-		return luaL_error(L, LUA_QL("powertype_t") " cannot be %u", p);
+		return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", p);
 	lua_pushinteger(L, powers[p]);
 	return 1;
 }
@@ -640,7 +640,7 @@ static int power_set(lua_State *L)
 	powertype_t p = luaL_checkinteger(L, 2);
 	UINT16 i = (UINT16)luaL_checkinteger(L, 3);
 	if (p >= NUMPOWERS)
-		return luaL_error(L, LUA_QL("powertype_t") " cannot be %u", p);
+		return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", p);
 	if (hud_running)
 		return luaL_error(L, "Do not alter player_t in HUD rendering code!");
 	powers[p] = i;