I'm trying to make a script that makes the player disappear when "E" is pressed on the keyboard. The parts are disappearing but at different times. Here's the full script:
local player = game:GetService("Players").LocalPlayer.Character:GetChildren() local userinput = game:GetService("UserInputService") userinput.InputBegan:Connect(function(key) for i, v in pairs(player) do if key.KeyCode == Enum.KeyCode.E then for i = 1,10 do v.Transparency = v.Transparency + 0.1 wait(0.001) end end end end)
By the way, I'm not sure how to get the accessories and face to disappear.
Try this:
local player = game:GetService("Players").LocalPlayer.Character:GetDescendants() -- This makes sure you get all the parts local userinput = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") -- for smooth effects userinput.InputBegan:Connect(function(key) if key.KeyCode == Enum.KeyCode.E then -- first check what key they press for _, instance in pairs(player) do -- then go through the character if instance:IsA("BasePart") or instance:IsA("Decal") then -- then check if it's a part or a decal TweenService:Create(instance, TweenInfo.new(1), {Transparency = 1}):Play() -- Then tween and make smooth transitions end end end end)
This is because you've set the code to only focus on one part.
For accessories, you can check if they exist in the character, then make their handle invisible.
For face, the face is inside the Head, so Head.face.Transparency.