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)
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)