So, I am having trouble with defining the head like.
local player = game:GetService(“Players”)
local humanoid = game:FindFirstChild(“Humanoid”)
player.Chatted:Connect(function(msg)
if msg == “/e headless” or “/e headless “ then
humanoid.Head.Transparency = 1
humanoid.Face:Destory()
humanoid.Decal:Destory()
end
I made this on mobile, tested it on studio but isn’t working, any problems?
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
player.Chatted:Connect(function(msg)
if msg == "/e headless" then
character.Head.Transparency = 1
character.Head.face:Destroy()
end
end)
To make the script work for everyone in the server, you’d need to use @Rynappel’s code in a local script and use RemoteEvents to connect it to the server.
If you want others too see you have a headless hra, then go ahead and use this code I’ve just written in short 3 minutes for you, can’t confirm if it works or not:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(chr)
player.Chatted:Connect(function(msg)
if msg == "/e headless" or "/e headless " then
player.Character.Head.Transparency = 1
player.Character.Head.face:Destroy()
else
print("Nope")
end
end)
end)
end)
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(msg)
if msg:lower():sub(1, 11) == "/e headless" then
local Character = Player.Character
if Character then
local Head = Character:FindFirstChild("Head")
if Head then
Head.Transparency = Head.Transparency == 1 and 0 or 1
local Face = Head:FindFirstChild("face")
if Face then
Face.Transparency = Face.Transparency == 1 and 0 or 1
end
end
end
end
end)
end)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(chr)
player.Chatted:Connect(function(msg)
if msg == "/e headless" or "/e headless " then
player.Character.Head.Transparency = 1
player.Character.Head.face.Transparency = 1 -- it says " face is not a valid member of Model "Workspace.vvKyee" "
end
end)
end)
end)