forked from cuberite/Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvanish.lua
More file actions
32 lines (23 loc) · 821 Bytes
/
Copy pathvanish.lua
File metadata and controls
32 lines (23 loc) · 821 Bytes
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
function HandleVanishCommand(Split, Player)
local function ChangeVanish( newPlayer )
newPlayer:SetVisible(not newPlayer:IsVisible());
if newPlayer:IsVisible() then
newPlayer:SendMessageSuccess("You aren't hidden anymore!")
else
newPlayer:SendMessageSuccess("You are now hidden!")
end
return true
end
if (Split[2] == nil or Split[2] == Player:GetName()) then
ChangeVanish(Player)
elseif Player:HasPermission("core.vanish.others") then
if cRoot:Get():FindAndDoWithPlayer( Split[2], ChangeVanish ) then
Player:SendMessageSuccess( Split[2] .. "s visibility has been toggled!")
else
SendMessageFailure( Player, "Player " .. Split[2] .. " isn't online!")
end
else
Player:SendMessageFailure("You need core.vanish.others permission to do that!")
end
return true
end