My code:
local RespawnTimes = {
Premium = 2;
Norm = 4;
}
local Admins = {
206143181;
}
game.Players.PlayerAdded:Connect(function(plr)
plr:SetAttribute("Disguised",false)
plr.CharacterAdded:Connect(function(Char)
Char:WaitForChild("Humanoid").Died:Connect(function()
if plr.MembershipType == Enum.MembershipType.Premium or table.find(Admins,plr.UserId) then
task.wait(RespawnTimes.Premium)
plr:LoadCharacter()
print(plr.DisplayName .. " respawned quickly")
else
task.wait(RespawnTimes.Norm)
plr:LoadCharacter()
end
end)
end)
plr.Chatted:Connect(function(msg)
msg = string.lower(msg)
local cmd = string.split(msg," ")[1]
if cmd == "/disguise" and plr:GetAttribute("Disguised") == false then
if plr.MembershipType == Enum.MembershipType.Premium or table.find(Admins,plr.UserId) then
plr:SetAttribute("Disguised",true)
local Hum = plr.Character:WaitForChild("Humanoid")
local ChosenId = math.random(1,2000000000)
Hum:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(ChosenId))
repeat task.wait() until workspace:FindFirstChild(plr.Name)
workspace:FindFirstChild(plr.Name).Humanoid.DisplayName = game.Players:GetPlayerByUserId(ChosenId).DisplayName
end
end
end)
end)