local player = game.Players.LocalPlayer local mouse = player:GetMouse() local function pickup(key) print("1") if (player.Character.Torso.Position - script.Parent.Position).Magnitude <= 10 then print("2") if key == "f" then print("3") game.Players[player.Name]:WaitForChild("Hunger").Value = game.Players[player.Name]:WaitForChild("Hunger").Value -5 script.Parent:Remove() end end end mouse.KeyDown:connect(pickup)
This code is in a LocalScript, stored in a part in the Workspace, none of the prints are working? Help? thanks
I think you should do...
mouse.KeyDown:connect(function(key) key = key:lower() if key == "f" then
and then put the rest of your code afterwards.
(if it doesn't work, just comment and I'll try again)