RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"just use Enum.RaycastFilterType.Exclude and Enum.RaycastFilterType.Include?"
I apologize for the confusion, but there seems to be a misunderstanding. The Enum.RaycastFilterType in Roblox does not have Exclude or Include as options. The correct options are Blacklist and Whitelist. Here is the corrected script with the correct enumeration: ```lua -- local script for climbing system local UserInputService = game:GetService("UserInputService") local RunService = game:GetService("RunService") local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local lastJumpTime = 0 local isClimbing = false local function onJumpRequest() local currentTime = tick() if currentTime - lastJumpTime < 0.3 then -- double press space local camera = workspace.CurrentCamera local rayOrigin = camera.CFrame.Position local rayDirection = camera.CFrame.LookVector * 10 local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.FilterDescendantsInstances = {character} raycastParams.IgnoreWater = true local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams) if raycastResult and raycastResult.Instance then humanoid:ChangeState(Enum.HumanoidStateType.Climbing) isClimbing = true end end lastJumpTime = currentTime end local function onRenderStepped() if isClimbing then local camera = workspace.CurrentCamera local rayOrigin = camera.CFrame.Position local rayDirection = camera.CFrame.LookVector * 10 local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.FilterDescendantsInstances = {character} raycastParams.IgnoreWater = true local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams) if not raycastResult or not raycastResult.Instance then humanoid:ChangeState(Enum.HumanoidStateType.Running) isClimbing = false end end end UserInputService.JumpRequest:Connect(onJumpRequest) RunService.RenderStepped:Connect(onRenderStepped) ``` This script should be placed in a LocalScript within the player's character or a GUI. It listens for double spacebar presses to initiate climbing and uses raycasting to determine if the player's camera is facing a climbable surface. The climbing state is maintained while the player is facing the surface and is stopped when they look away.