Hi, I'm currently working on a simple survival type game and I'm trying to make a script that lets a player eat a piece of food if they press a key while there holding the item. Here is my script:
game.Players.LocalPlayer.Backpack.Weat.Equipped:Connect(function()
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.KeyDown:connect(function(key)
if key == "e" then
print("Food Eaten")
end
end)
end)
Thanks

1 comment
Thanks for the reply, the script works perfectly!