I want to make a walljump mechanic, but I need a way to make a player get attached to a wall first. My current localscript is this:
local plr = game.Players.LocalPlayer
local char = plr.Character
local isAttached = false
char:WaitForChild("Humanoid").Touched:Connect(function(p)
if p:IsA("Part") and p:FindFirstChild("_Wall") and isAttached == false then
isAttached = true
print("Player is touching a walljump")
spawn(function()
count()
end)
end
end)
function count()
--Counting down 3 seconds and changing is attached to false
for i = 3, 0, -1 do
wait(1)
print(i)
if i == 0 then
isAttached = false
end
end
end