Greetings all,
I have been trying to work this out for hours, I still, clearly have no idea. Basically, I have created a use button for the players inventory, when they use an apple, lets say, it will damage the player(Just for testing purposes). I am using bindable functions with :Invoke() and :OnInvoke(). There is no output errors, and the 'use' button inside the players inventory does nothing!
The code:
-- InventoryModule inside replicated storage
inventoryModule.ConsumeItem = function(player, item)
local gameItem = game.ReplicatedStorage.Global_Items.Game_Items:FindFirstChild(item.Name)
if gameItem then
if player then --It passes the if statements
item.Use:Invoke(player) --It doesn't invoke?
end
end
end
-- Inside a local script, inside a bindable function, inside the item, inside the players inventory folder. Like this:
--Player1
--Inventory
-- Apple
--ImageId
--Item Type
--Use
--UseScript
function script.Parent.OnInvoke(player)
if player and player.Character then
player.Character.Humanoid:TakeDamage(10)
end
end
Thanks in advance, Brandon. <3

2 comments
Scripts / LocalScripts can't communicate between each other using BindableFunctions -- you would need to use a RemoteFunction for that (not completely solid on how you're set up, so this might not be relevant). Also try printing at different places to see what is running
Ah, this explains a lot. Thanks dude, I will give it a shot!