I have a local script inside a campfire and when a player is near the campfire and they press "F" its supposed to print because i am just testing it, but it doesnt do anything. The script doesnt even run the print at the top. So I think the script isnt running at all.
Heres the code
local Player = game.Players.LocalPlayer
print("Active")
function OnKeyPress(InputObject, GameProcessedEvent)
if not GameProcessedEvent then
local Magnitude = (Player.Character.HumanoidRootPart.Position - script.Parent.HitBox.Position).magnitude
if InputObject.KeyCode == Enum.KeyCode.F and Magnitude >= 0 and Magnitude <= 7.5 then
print("F Pressed")
end
end
end
game:GetService("UserInputService").InputBegan:Connect(OnKeyPress)
I am convinced the script isnt even running, any ideas?
I dont wanna switch it to a normal script, that will cause far to much extra work.
