-- Add a constant for potion item ID
local HEALTH_POTION_ID = 2120000 -- Replace with the actual ID of your health potion item
-- Add a function for automatic potion consumption
local function autoConsumePotion()
local playerHealth = _UserService.LocalPlayer.WsCharacterData.HP
local potionThreshold = 50 -- Adjust the threshold as needed
if playerHealth < potionThreshold then
_ItemConsumeLogic:TryConsumeFromFuncKey(HEALTH_POTION_ID)
endend
-- ... (your existing code)
-- Modify the existing user_check_func to include potion consumption
zz_y7.user_check_func = function ()
-- ... (your existing code)
-- Add potion consumption check
autoConsumePotion()end
-- ... (your existing code)
댓글1
되셨나요?