I made a custom crawling system but I need help in that the player can’t get up in specific places or in small places
so i tried script the next parts
There are 3 parts
Red Part: to detect a player touching it and DISABLE a boolean called “CanJump” that can enable if the player can jump or not
There’s the RED part script:
script.Parent.Touched:Connect(function(hit)
if game.Players:FindFirstChild(hit.Parent.Name) and game.Players:FindFirstChild(hit.Parent.Name):FindFirstChild("CanJump") and game.Players:FindFirstChild(hit.Parent.Name):WaitForChild("CanJump").Value == true then --Detect the player and the boolean "CanJump"
local plr = game.Players:FindFirstChild(hit.Parent.Name)
plr:WaitForChild("CanJump").Value = false --Disable the boolean
end
end)
Blue Parts: to detect a player touching it and ENABLE the boolean “CanJump” that can enable if the player can jump or not
There’s the BLUE parts script:
script.Parent.Touched:Connect(function(hit)
if game.Players:FindFirstChild(hit.Parent.Name) and game.Players:FindFirstChild(hit.Parent.Name):FindFirstChild("CanJump") and game.Players:FindFirstChild(hit.Parent.Name):WaitForChild("CanJump").Value == false then --Detect the player and the boolean "CanJump"
local plr = game.Players:FindFirstChild(hit.Parent.Name)
plr:WaitForChild("CanJump").Value = true --Enable the boolean "CanJump"
end
end)
It’s working but it has errors