I am making a game, and I have a tool that while I am holding F, it should print something, but after I hold F, it keeps printing even though I’m not holding F anymore.
LocalScript
inputs.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
if not player.Backpack:FindFirstChild("Wood sword") then
while input.KeyCode == Enum.KeyCode.F do
wait(.1)
game.ReplicatedStorage.BlockEvent:FireServer()
end
end
end
end)
ServerScript
game.ReplicatedStorage.BlockEvent.OnServerEvent:Connect(function(player)
print("Block event has been recieved")
end)