Basically I'm making a dash where you go invisible and your walk speed increases briefly when you press Q, I got the part where you go invisible but when I try to make the character reappear it only does 1 body part at a time and it makes 1 body part appear for the wait time (Example: 2s), I am new to scripting so this is a big thud for me and I don't know where to start to resolve this issue and cant find anything about it on forums.
``Lua
local Uis = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = Player.Character
Uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.Q then else return end
for i,v in pairs(Player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
v.Transparency = 1
end
end
end)
Uis.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.Q then else return end
for i,v in pairs(Player.Character:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
wait(2)
v.Transparency = 0
Player.Character:WaitForChild("HumanoidRootPart").Transparency = 1
end
end
end)
``
** You are now Level 1! **