I cant seem to find why my climbing in my game isnt being disabled

hello everyone im making a game and i need to have climbing disables so the player doesnt reach places where they shouldnt be. (yes i have invs barriers but i cant have them everywhere cause the game will be unplayable.

here is the current script im using. (it used to work fine but now it doesnt with no error in output)

local Player = game:GetService(‘Players’).LocalPlayer
Player.CharacterAdded:Wait()
local humanoid = Player.Character:FindFirstChild(“Humanoid”)
repeat wait(0.1)
game:GetService(“StarterGui”):SetCore(“ResetButtonCallback”, false)
until game:GetService(“StarterGui”):SetCore(“ResetButtonCallback”, false)
repeat wait(0.1)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
until Player.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
local StarterPlayer = game:GetService(“StarterPlayer”)
StarterPlayer.EnableMouseLockOption = false
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)

anyone have any idea what should i do?

2 Likes
local Player = game:GetService('Players').LocalPlayer
Player.CharacterAdded:Wait()

local humanoid = Player.Character:FindFirstChild("Humanoid")

-- Disable ResetButtonCallback
repeat
    wait(0.1)
    game:GetService("StarterGui"):SetCore("ResetButtonCallback", false)
until game:GetService("StarterGui"):GetCore("ResetButtonCallback") == false

-- Disable climbing
repeat
    wait(0.1)
    humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
until humanoid:GetStateEnabled(Enum.HumanoidStateType.Climbing) == false

-- Disable mouse lock option
local StarterPlayer = game:GetService("StarterPlayer")
StarterPlayer.EnableMouseLockOption = false

-- Disable jumping
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)

This script should properly disable climbing, jumping, and the mouse lock option for the player character.

1 Like

Thanks This Worked. (i had to change some minor things so it could actually work with no errors)

and if anyone looks at this in the future and wants to know what i changed here is my final scipt:

local Player = game:GetService('Players').LocalPlayer
Player.CharacterAdded:Wait()

local humanoid = Player.Character:FindFirstChild("Humanoid")

local coreCall do
	local MAX_RETRIES = 8

	local StarterGui = game:GetService('StarterGui')
	local RunService = game:GetService('RunService')

	function coreCall(method, ...)
		local result = {}
		for retries = 1, MAX_RETRIES do
			result = {pcall(StarterGui[method], StarterGui, ...)}
			if result[1] then
				break
			end
			RunService.Stepped:Wait()
		end
		return unpack(result)
	end
end

coreCall('SetCore', 'ResetButtonCallback', false)


repeat
	wait(0.1)
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
until humanoid:GetStateEnabled(Enum.HumanoidStateType.Climbing) == false


local StarterPlayer = game:GetService("StarterPlayer")
StarterPlayer.EnableMouseLockOption = false


humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.