-
Notifications
You must be signed in to change notification settings - Fork 1
/
red-001_contrib.lua
32 lines (30 loc) · 990 Bytes
/
red-001_contrib.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- Thank you red-001 for contributing to the morecommands mod!
-- It is greatly appreciated!
-- Setyaw by red-001
minetest.register_chatcommand("yaw", {
params = "<yaw>",
description = "Set player yaw",
func = function(name, param)
if (param ~= '') and tonumber(param) then
local player = minetest.get_player_by_name(name)
player:set_look_yaw(math.rad(param))
return true, "Yaw set to "..param
else
minetest.chat_send_player(name, minetest.colorize("#FF0000", "Invalid Usage."))
end
end,
})
-- Setpitch by red-001
minetest.register_chatcommand("pitch", {
params = "<pitch>",
description = "Set player pitch",
func = function(name, param)
if (param ~= '') and tonumber(param) then
local player = minetest.get_player_by_name(name)
player:set_look_pitch(math.rad(param))
return true, "Pitch set to "..param
else
minetest.chat_send_player(name, minetest.colorize("#FF0000", "Invalid Usage."))
end
end,
})